Skip to content

Commit

Permalink
Build wayland suppport optionally
Browse files Browse the repository at this point in the history
  • Loading branch information
mid-kid authored and john-preston committed Nov 17, 2020
1 parent d9e8a60 commit 4436815
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ endif()
add_checked_subdirectory(iconv)
add_checked_subdirectory(jpeg)
add_checked_subdirectory(lz4)
if (LINUX)
if (LINUX AND NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
add_checked_subdirectory(materialdecoration)
endif()
add_checked_subdirectory(minizip)
Expand Down
54 changes: 37 additions & 17 deletions external/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,22 @@ else()
)
endif()

if (Qt5WaylandClient_FOUND)
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/include/QtWaylandClient
${qt_loc}/include/QtWaylandClient/${qt_version}
${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient
)
endif()

if (LINUX)
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/include/QtSvg
${qt_loc}/include/QtThemeSupport
${qt_loc}/include/QtWaylandClient
${qt_loc}/include/QtThemeSupport/${qt_version}
${qt_loc}/include/QtWaylandClient/${qt_version}
${qt_loc}/include/QtThemeSupport/${qt_version}/QtThemeSupport
${qt_loc}/include/QtWaylandClient/${qt_version}/QtWaylandClient
)
endif()

Expand Down Expand Up @@ -151,10 +157,16 @@ else()
)
endif()

if (LINUX)
if (Qt5WaylandClient_FOUND)
target_compile_definitions(external_qt
INTERFACE
QT_WAYLANDCLIENT_LIB
)
endif()

if (LINUX)
target_compile_definitions(external_qt
INTERFACE
QT_THEME_SUPPORT_LIB
QT_SVG_LIB
)
Expand Down Expand Up @@ -261,21 +273,29 @@ else()
plugins/bearer/${qt_lib_prefix}qnmbearer
)
endif()
set(qt_libs_waylandclient)
set(qt_libs_waylandclient_plugins)
if (Qt5WaylandClient_FOUND)
set(qt_libs_waylandclient lib/${qt_lib_prefix}Qt5WaylandClient)
set(qt_libs_waylandclient_plugins
plugins/wayland-decoration-client/${qt_lib_prefix}bradient
plugins/wayland-shell-integration/${qt_lib_prefix}ivi-shell
plugins/wayland-shell-integration/${qt_lib_prefix}wl-shell
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell-v5
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell-v6
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell
plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl
plugins/wayland-graphics-integration-client/${qt_lib_prefix}drm-egl-server
plugins/wayland-graphics-integration-client/${qt_lib_prefix}dmabuf-server
plugins/wayland-graphics-integration-client/${qt_lib_prefix}shm-emulation-server
plugins/platforms/${qt_lib_prefix}qwayland-egl
plugins/platforms/${qt_lib_prefix}qwayland-generic
)
endif()
set(qt_libs
plugins/platforminputcontexts/${qt_lib_prefix}composeplatforminputcontextplugin
${qt_libs_dbus_plugins}
plugins/wayland-decoration-client/${qt_lib_prefix}bradient
plugins/wayland-shell-integration/${qt_lib_prefix}ivi-shell
plugins/wayland-shell-integration/${qt_lib_prefix}wl-shell
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell-v5
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell-v6
plugins/wayland-shell-integration/${qt_lib_prefix}xdg-shell
plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl
plugins/wayland-graphics-integration-client/${qt_lib_prefix}drm-egl-server
plugins/wayland-graphics-integration-client/${qt_lib_prefix}dmabuf-server
plugins/wayland-graphics-integration-client/${qt_lib_prefix}shm-emulation-server
plugins/platforms/${qt_lib_prefix}qwayland-egl
plugins/platforms/${qt_lib_prefix}qwayland-generic
${qt_libs_waylandclient_plugins}
plugins/platforms/${qt_lib_prefix}qxcb
plugins/imageformats/${qt_lib_prefix}qsvg
plugins/iconengines/${qt_lib_prefix}qsvgicon
Expand All @@ -287,7 +307,7 @@ else()
${qt_libs_dbus_support}
plugins/bearer/${qt_lib_prefix}qgenericbearer
${qt_libs_dbus_bearers}
lib/${qt_lib_prefix}Qt5WaylandClient
${qt_libs_waylandclient}
lib/${qt_lib_prefix}Qt5ServiceSupport
${common_qt_libs}
${qt_libs_dbus}
Expand Down
6 changes: 4 additions & 2 deletions external/qt/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
find_package(Qt5Gui COMPONENTS QWebpPlugin REQUIRED)

if (LINUX)
find_package(Qt5 COMPONENTS WaylandClient REQUIRED)
find_package(Qt5 OPTIONAL_COMPONENTS XkbCommonSupport QUIET)
if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
find_package(Qt5 COMPONENTS WaylandClient REQUIRED)
find_package(Qt5 OPTIONAL_COMPONENTS XkbCommonSupport QUIET)
endif()

if (NOT DESKTOP_APP_USE_PACKAGED OR DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES)
find_package(Qt5 COMPONENTS Svg REQUIRED)
Expand Down
7 changes: 7 additions & 0 deletions options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ if (DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
)
endif()

if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
target_compile_definitions(common_options
INTERFACE
DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
)
endif()

if (DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION)
target_compile_definitions(common_options
INTERFACE
Expand Down
1 change: 1 addition & 0 deletions variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ endif()

option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON)
option(DESKTOP_APP_DISABLE_DBUS_INTEGRATION "Disable all code for D-Bus integration (Linux only)." OFF)
option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF)
option(DESKTOP_APP_DISABLE_WEBRTC_INTEGRATION "Disable all code for WebRTC integration." OFF)
option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." OFF)
option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ${no_special_target})
Expand Down

0 comments on commit 4436815

Please sign in to comment.