From a512f549249df0403f6dafea4c3a0e3774c3eae1 Mon Sep 17 00:00:00 2001 From: "Tobias C. Berner" Date: Sun, 23 Jul 2017 12:02:58 +0200 Subject: [PATCH] Hide the Linux specific parts behind check for headers Summary: Only build * `virtual_terminal.cpp` in the presence of `linux/vt.h` * `fbdev`-backend in the precense of `linux/fb.h` Test Plan: Reviewers: #kwin, #freebsd, graesslin, bcooksley Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D6847 --- CMakeLists.txt | 15 ++++++++++++++- plugins/platforms/CMakeLists.txt | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bfe3e6f95..b28e8ffd4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,6 +325,14 @@ add_feature_info("prctl/procctl tracing control" configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h ) +check_include_file("linux/vt.h" HAVE_LINUX_VT_H) +add_feature_info("linux/vt.h" + HAVE_LINUX_VT_H + "Required for virtual terminal support under wayland") +check_include_file("linux/fb.h" HAVE_LINUX_FB_H) +add_feature_info("linux/fb.h" + HAVE_LINUX_FB_H + "Required for the fbdev backend") ########### global ############### set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml) @@ -480,8 +488,13 @@ if(HAVE_INPUT) libinput/device.cpp libinput/events.cpp libinput/libinput_logging.cpp - virtual_terminal.cpp ) + if (HAVE_LINUX_VT_H) + set(kwin_KDEINIT_SRCS + ${kwin_KDEINIT_SRCS} + virtual_terminal.cpp + ) + endif() endif() kconfig_add_kcfg_files(kwin_KDEINIT_SRCS settings.kcfgc) diff --git a/plugins/platforms/CMakeLists.txt b/plugins/platforms/CMakeLists.txt index dc70869c81..485baaa75a 100644 --- a/plugins/platforms/CMakeLists.txt +++ b/plugins/platforms/CMakeLists.txt @@ -2,7 +2,9 @@ if(HAVE_INPUT) if(HAVE_DRM) add_subdirectory(drm) endif() - add_subdirectory(fbdev) + if (HAVE_LINUX_FB_H) + add_subdirectory(fbdev) + endif() if(HAVE_LIBHYBRIS) add_subdirectory(hwcomposer) endif()