From 3d2b39935caf747a48a0430e5bbfe160320b3397 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 8 Oct 2020 09:55:37 +0300 Subject: [PATCH 01/17] Update Qt version to 5.15.1. --- external/qt/package.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/qt/package.cmake b/external/qt/package.cmake index d7697ec..62d2a09 100644 --- a/external/qt/package.cmake +++ b/external/qt/package.cmake @@ -6,7 +6,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED) if (NOT APPLE OR NOT build_osx) - set(qt_version 5.12.8) + set(qt_version 5.15.1) else() set(qt_version 5.6.2) endif() From 94025be392ab7e58115ac376cbf449cdca10de22 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 27 Oct 2020 13:30:10 +0300 Subject: [PATCH 02/17] Add GSS Framework on macOS for Qt 5.15.1. --- options_mac.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/options_mac.cmake b/options_mac.cmake index 7acd4f9..6411cc8 100644 --- a/options_mac.cmake +++ b/options_mac.cmake @@ -75,6 +75,7 @@ INTERFACE AppKit CoreWLAN IOKit + GSS ) if (NOT build_osx) From 3a2d8a252d7e84547b532605aaa557a8c70d6d0f Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 4 Nov 2020 16:08:52 +0300 Subject: [PATCH 03/17] Build with Qt 5.15.1 in CentOS 7 docker. --- external/qt/CMakeLists.txt | 19 +++++++++++++++---- external/webrtc/CMakeLists.txt | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index 110c3fd..ab38c44 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -288,12 +288,12 @@ else() plugins/bearer/${qt_lib_prefix}qgenericbearer ${qt_libs_dbus_bearers} lib/${qt_lib_prefix}Qt5WaylandClient + lib/${qt_lib_prefix}Qt5ServiceSupport ${common_qt_libs} ${qt_libs_dbus} lib/${qt_lib_prefix}Qt5Svg lib/${qt_lib_prefix}Qt5Core lib/${qt_lib_prefix}qtpcre2 - lib/${qt_lib_prefix}xcb-static ) foreach (lib ${qt_libs}) list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") @@ -345,10 +345,21 @@ else() wayland-client xkbcommon xkbcommon-x11 - Xi Xext - Xfixes - Xrender + xcb-xkb + xcb-randr + xcb-icccm + xcb-shm + xcb-render + xcb-image + xcb-xfixes + xcb-xinerama + xcb-xinput + xcb-shape + xcb-sync + xcb-util + xcb-render-util + xcb-keysyms ffi ) if (DESKTOP_APP_USE_GLIBC_WRAPS) diff --git a/external/webrtc/CMakeLists.txt b/external/webrtc/CMakeLists.txt index 8adb2d2..477fc6f 100644 --- a/external/webrtc/CMakeLists.txt +++ b/external/webrtc/CMakeLists.txt @@ -99,5 +99,6 @@ else() ${webrtc_libs_list} desktop-app::external_openssl desktop-app::external_jpeg + desktop-app::external_opus ) endif() From 4bf45519f6b39afa85e394c19680971fd92bfac4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 6 Nov 2020 08:48:01 +0300 Subject: [PATCH 04/17] Disable Linux GLIBC wraps for special builds. --- variables.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.cmake b/variables.cmake index 9e7f41f..8bb9aeb 100644 --- a/variables.cmake +++ b/variables.cmake @@ -29,7 +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_WEBRTC_INTEGRATION "Disable all code for WebRTC integration." OFF) -option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." ${linux_special_target}) +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}) option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF) option(DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES "Bundle recommended Qt platform themes for self-contained packages. (Linux only)" ${DESKTOP_APP_USE_PACKAGED_LAZY}) From d9e8a608c21ca175ed118955d83010580fb46e65 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 6 Nov 2020 20:19:54 +0300 Subject: [PATCH 05/17] Add possibility to build on Windows for x64. --- external/auto_updates/lzma/CMakeLists.txt | 8 +++++++- external/crash_reports/breakpad/CMakeLists.txt | 8 +++++++- external/openssl/CMakeLists.txt | 6 +++++- external/opus/CMakeLists.txt | 7 ++++++- external/zlib/CMakeLists.txt | 7 ++++++- options_win.cmake | 9 +++++++++ run_cmake.py | 12 ++++++++++-- validate_special_target.cmake | 4 +++- variables.cmake | 17 ++++++++++++++--- 9 files changed, 67 insertions(+), 11 deletions(-) diff --git a/external/auto_updates/lzma/CMakeLists.txt b/external/auto_updates/lzma/CMakeLists.txt index be81966..2d24284 100644 --- a/external/auto_updates/lzma/CMakeLists.txt +++ b/external/auto_updates/lzma/CMakeLists.txt @@ -12,7 +12,13 @@ INTERFACE ${libs_loc}/lzma/C ) -set(lzma_lib_loc ${libs_loc}/lzma/C/Util/LzmaLib/$,Debug,Release>) +if (build_win64) + set(lzma_platform_dir x64/) +else() + set(lzma_platform_dir "") +endif() + +set(lzma_lib_loc ${libs_loc}/lzma/C/Util/LzmaLib/${lzma_platform_dir}$,Debug,Release>) target_link_libraries(external_lzma INTERFACE diff --git a/external/crash_reports/breakpad/CMakeLists.txt b/external/crash_reports/breakpad/CMakeLists.txt index c09243d..d57a17e 100644 --- a/external/crash_reports/breakpad/CMakeLists.txt +++ b/external/crash_reports/breakpad/CMakeLists.txt @@ -12,7 +12,13 @@ INTERFACE ${libs_loc}/breakpad/src ) -set(breakpad_lib_loc ${libs_loc}/breakpad/src/out/$,Debug,Release>/obj/client) +if (build_win64) + set(breakpad_config_add _x64) +else() + set(breakpad_config_add "") +endif() + +set(breakpad_lib_loc ${libs_loc}/breakpad/src/out/$,Debug${breakpad_config_add},Release${breakpad_config_add}>/obj/client) if (WIN32) target_link_libraries(external_breakpad diff --git a/external/openssl/CMakeLists.txt b/external/openssl/CMakeLists.txt index 8be0cbb..d66b5d8 100644 --- a/external/openssl/CMakeLists.txt +++ b/external/openssl/CMakeLists.txt @@ -9,7 +9,11 @@ add_library(desktop-app::external_openssl ALIAS external_openssl) if (WIN32) set(openssl_lib_ext lib) - set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32) + if (build_win64) + set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out64) + else() + set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32) + endif() else() set(openssl_lib_ext a) if (APPLE) diff --git a/external/opus/CMakeLists.txt b/external/opus/CMakeLists.txt index 527902b..71bfd65 100644 --- a/external/opus/CMakeLists.txt +++ b/external/opus/CMakeLists.txt @@ -21,7 +21,12 @@ else() INTERFACE ${libs_loc}/opus/include ) - set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/Win32) + if (build_win64) + set(opus_config_folder x64) + else() + set(opus_config_folder Win32) + endif() + set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/${opus_config_folder}) set_target_properties(external_opus PROPERTIES IMPORTED_LOCATION "${opus_lib_loc}/Release/opus.lib" IMPORTED_LOCATION_DEBUG "${opus_lib_loc}/Debug/opus.lib" diff --git a/external/zlib/CMakeLists.txt b/external/zlib/CMakeLists.txt index 34e4874..f3be3d5 100644 --- a/external/zlib/CMakeLists.txt +++ b/external/zlib/CMakeLists.txt @@ -13,7 +13,12 @@ if (DESKTOP_APP_USE_PACKAGED) elseif (WIN32) target_compile_definitions(external_zlib INTERFACE ZLIB_WINAPI) target_include_directories(external_zlib INTERFACE ${libs_loc}/zlib) - set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/x86/ZlibStat$,Debug,ReleaseWithoutAsm>) + if (build_win64) + set(zlib_config_folder x64) + else() + set(zlib_config_folder x86) + endif() + set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/${zlib_config_folder}/ZlibStat$,Debug,ReleaseWithoutAsm>) target_link_libraries(external_zlib INTERFACE ${zlib_lib_loc}/zlibstat.lib) elseif (APPLE AND NOT build_osx) target_link_libraries(external_zlib INTERFACE /usr/local/macos/lib/libz.a) diff --git a/options_win.cmake b/options_win.cmake index 4635992..362dd4e 100644 --- a/options_win.cmake +++ b/options_win.cmake @@ -26,6 +26,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") /w15038 # wrong initialization order /w14265 # class has virtual functions, but destructor is not virtual /wd4068 # Disable "warning C4068: unknown pragma" + /wd4267 # 'initializing': conversion from 'size_t' to 'int', possible loss of data. + /wd4244 # '=': conversion from 'size_t' to 'int', possible loss of data. /Zc:wchar_t- # don't tread wchar_t as builtin type /Zi ) @@ -34,6 +36,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") INTERFACE $,/NODEFAULTLIB:LIBCMT,/DEBUG;/OPT:REF> ) + + if (build_win64) + target_compile_options(common_options + INTERFACE + /bigobj # scheme.cpp has too many sections. + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_definitions(common_options INTERFACE diff --git a/run_cmake.py b/run_cmake.py index 8ae7861..20a3c49 100644 --- a/run_cmake.py +++ b/run_cmake.py @@ -12,14 +12,22 @@ def run(project, arguments, buildType=''): basePath = scriptPath + '/../out/' + buildType cmake = ['cmake'] + windowsArch = '' for arg in arguments: if arg == 'debug': cmake.append('-DCMAKE_BUILD_TYPE=Debug') + elif arg == 'x86' or arg == 'x64': + windowsArch = arg elif arg != 'force': cmake.append(arg) - if sys.platform == 'win32': - cmake.append('-AWin32') + if windowsArch == 'x64': + cmake.append('-Ax64') + else: + cmake.append('-AWin32') # default + elif windowsArch != '': + print("[ERROR] x86/x64 switch is supported only on Windows.") + return 1 elif sys.platform == 'darwin': cmake.append('-GXcode') elif buildType: diff --git a/validate_special_target.cmake b/validate_special_target.cmake index c87b135..97f61be 100644 --- a/validate_special_target.cmake +++ b/validate_special_target.cmake @@ -20,7 +20,9 @@ endif() if (WIN32) if (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp" - AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win") + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64" + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win" + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64") report_bad_special_target() endif() elseif (APPLE) diff --git a/variables.cmake b/variables.cmake index 8bb9aeb..4431fba 100644 --- a/variables.cmake +++ b/variables.cmake @@ -22,6 +22,7 @@ endif() set(disable_autoupdate 0) if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "" OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp" + OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64" OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore") set(disable_autoupdate 1) endif() @@ -57,12 +58,20 @@ endif() set(build_osx 0) set(build_macstore 0) -set(build_winstore 0) +set(build_winstore 0) # 32 or 64 bit set(build_linux32 0) +set(build_win64 0) # normal or uwp +set(build_winstore64 0) if (WIN32) - if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp") + if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64") + set(build_win64 1) + elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp") set(build_winstore 1) + elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64") + set(build_win64 1) + set(build_winstore 1) + set(build_winstore64 1) endif() elseif (APPLE) if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx") @@ -90,7 +99,9 @@ else() endif() endif() -if (NOT APPLE OR build_osx) +if (build_win64) + get_filename_component(libs_loc "../Libraries/win64" REALPATH) +elseif (NOT APPLE OR build_osx) get_filename_component(libs_loc "../Libraries" REALPATH) else() get_filename_component(libs_loc "../Libraries/macos" REALPATH) From 4436815d19035aaba79cb69b7e2d599ae286297d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 12 Nov 2020 00:15:46 +0100 Subject: [PATCH 06/17] Build wayland suppport optionally --- external/CMakeLists.txt | 2 +- external/qt/CMakeLists.txt | 54 ++++++++++++++++++++++++++------------ external/qt/package.cmake | 6 +++-- options.cmake | 7 +++++ variables.cmake | 1 + 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 7cd03d6..dca143e 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -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) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index ab38c44..0aa22a5 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -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() @@ -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 ) @@ -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 @@ -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} diff --git a/external/qt/package.cmake b/external/qt/package.cmake index 62d2a09..60d92cc 100644 --- a/external/qt/package.cmake +++ b/external/qt/package.cmake @@ -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) diff --git a/options.cmake b/options.cmake index 8d1c52b..89eea38 100644 --- a/options.cmake +++ b/options.cmake @@ -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 diff --git a/variables.cmake b/variables.cmake index 4431fba..c30a1ca 100644 --- a/variables.cmake +++ b/variables.cmake @@ -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}) From 28b11b099ad54151f38b7d5c0c00ff9ce12d4674 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Dec 2020 15:49:45 +0400 Subject: [PATCH 07/17] Update Qt to 5.15.2. --- external/qt/package.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/qt/package.cmake b/external/qt/package.cmake index 60d92cc..3f9f859 100644 --- a/external/qt/package.cmake +++ b/external/qt/package.cmake @@ -6,7 +6,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED) if (NOT APPLE OR NOT build_osx) - set(qt_version 5.15.1) + set(qt_version 5.15.2) else() set(qt_version 5.6.2) endif() From f29f5e727f9a4e947ce7cc4456256eb07d3c8c7f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 8 Dec 2020 08:34:54 +0300 Subject: [PATCH 08/17] Added XCB Record extension to Qt. --- external/qt/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index 0aa22a5..fdbd4df 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -380,6 +380,7 @@ else() xcb-util xcb-render-util xcb-keysyms + xcb-record ffi ) if (DESKTOP_APP_USE_GLIBC_WRAPS) From 1c2be0df28feb0c4629a1f37ccf7d23da2ff17c1 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 9 Dec 2020 20:20:56 +0400 Subject: [PATCH 09/17] Add xcb-keysyms and xcb-record dependencies --- external/qt/CMakeLists.txt | 1 - external/xcb/CMakeLists.txt | 2 ++ external/xcb/xcb_keysyms/CMakeLists.txt | 16 ++++++++++++++++ external/xcb/xcb_record/CMakeLists.txt | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 external/xcb/xcb_keysyms/CMakeLists.txt create mode 100644 external/xcb/xcb_record/CMakeLists.txt diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index fdbd4df..0aa22a5 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -380,7 +380,6 @@ else() xcb-util xcb-render-util xcb-keysyms - xcb-record ffi ) if (DESKTOP_APP_USE_GLIBC_WRAPS) diff --git a/external/xcb/CMakeLists.txt b/external/xcb/CMakeLists.txt index d413d1e..0f16bf3 100644 --- a/external/xcb/CMakeLists.txt +++ b/external/xcb/CMakeLists.txt @@ -7,6 +7,8 @@ add_library(external_xcb INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_xcb ALIAS external_xcb) +add_subdirectory(xcb_keysyms) +add_subdirectory(xcb_record) add_subdirectory(xcb_screensaver) if (DESKTOP_APP_USE_PACKAGED) diff --git a/external/xcb/xcb_keysyms/CMakeLists.txt b/external/xcb/xcb_keysyms/CMakeLists.txt new file mode 100644 index 0000000..59cf070 --- /dev/null +++ b/external/xcb/xcb_keysyms/CMakeLists.txt @@ -0,0 +1,16 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_xcb_keysyms INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_xcb_keysyms ALIAS external_xcb_keysyms) + +if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(XCB_KEYSYMS REQUIRED IMPORTED_TARGET xcb-keysyms) + target_link_libraries(external_xcb_keysyms INTERFACE PkgConfig::XCB_KEYSYMS) +else() + target_link_static_libraries(external_xcb_keysyms INTERFACE xcb-keysyms) +endif() diff --git a/external/xcb/xcb_record/CMakeLists.txt b/external/xcb/xcb_record/CMakeLists.txt new file mode 100644 index 0000000..798b9f2 --- /dev/null +++ b/external/xcb/xcb_record/CMakeLists.txt @@ -0,0 +1,16 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_xcb_record INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_xcb_record ALIAS external_xcb_record) + +if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(XCB_RECORD REQUIRED IMPORTED_TARGET xcb-record) + target_link_libraries(external_xcb_record INTERFACE PkgConfig::XCB_RECORD) +else() + target_link_static_libraries(external_xcb_record INTERFACE xcb-record) +endif() From ceb5808939cf770c33be996ab3a1d38a998bf16d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 14 Dec 2020 16:18:12 +0400 Subject: [PATCH 10/17] Xext is not used by Qt, wayland-client is not used by ffmpeg --- external/ffmpeg/CMakeLists.txt | 1 - external/qt/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/external/ffmpeg/CMakeLists.txt b/external/ffmpeg/CMakeLists.txt index bd9a1cf..027b4dd 100644 --- a/external/ffmpeg/CMakeLists.txt +++ b/external/ffmpeg/CMakeLists.txt @@ -68,7 +68,6 @@ else() va-drm va vdpau - wayland-client Xext Xfixes ) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index 0aa22a5..f31a3cd 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -365,7 +365,6 @@ else() wayland-client xkbcommon xkbcommon-x11 - Xext xcb-xkb xcb-randr xcb-icccm From b5124ece3e4d36fbaf34cfa84f6141c015580055 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 15 Dec 2020 12:24:53 +0400 Subject: [PATCH 11/17] Remove unneeded Qt static plugins --- external/qt/CMakeLists.txt | 12 ------------ external/qt/package.cmake | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index f31a3cd..db226ce 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -26,10 +26,6 @@ if (DESKTOP_APP_USE_PACKAGED) target_link_libraries(external_qt INTERFACE Qt5::DBus) endif() - if (Qt5Svg_FOUND) - target_link_libraries(external_qt INTERFACE Qt5::Svg) - endif() - if (LINUX AND DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES) find_library(Qt5ThemeSupport_LIBRARY NAMES @@ -125,7 +121,6 @@ else() if (LINUX) target_include_directories(external_qt SYSTEM INTERFACE - ${qt_loc}/include/QtSvg ${qt_loc}/include/QtThemeSupport ${qt_loc}/include/QtThemeSupport/${qt_version} ${qt_loc}/include/QtThemeSupport/${qt_version}/QtThemeSupport @@ -168,7 +163,6 @@ else() target_compile_definitions(external_qt INTERFACE QT_THEME_SUPPORT_LIB - QT_SVG_LIB ) endif() @@ -281,13 +275,8 @@ else() 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 ) @@ -297,7 +286,6 @@ else() ${qt_libs_dbus_plugins} ${qt_libs_waylandclient_plugins} plugins/platforms/${qt_lib_prefix}qxcb - plugins/imageformats/${qt_lib_prefix}qsvg plugins/iconengines/${qt_lib_prefix}qsvgicon lib/${qt_lib_prefix}Qt5XcbQpa lib/${qt_lib_prefix}Qt5EglSupport diff --git a/external/qt/package.cmake b/external/qt/package.cmake index 3f9f859..fedb6eb 100644 --- a/external/qt/package.cmake +++ b/external/qt/package.cmake @@ -29,7 +29,7 @@ if (LINUX) find_package(Qt5 OPTIONAL_COMPONENTS XkbCommonSupport QUIET) endif() - if (NOT DESKTOP_APP_USE_PACKAGED OR DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES) + if (NOT DESKTOP_APP_USE_PACKAGED) find_package(Qt5 COMPONENTS Svg REQUIRED) endif() From 29a45b899bbda3ce06329f760b470ea7f1cbdcf1 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 15 Dec 2020 17:19:42 +0400 Subject: [PATCH 12/17] Deduplicate jpeg and zlib linking in qt --- external/qt/CMakeLists.txt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index db226ce..e33d215 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -208,11 +208,6 @@ else() foreach (lib ${qt_libs}) list(APPEND qt_libs_list "${qt_loc}/${lib}${qt_lib_suffix}") endforeach() - target_link_libraries(external_qt - INTERFACE - desktop-app::external_jpeg - desktop-app::external_zlib - ) elseif (APPLE) if (NOT build_osx) set(qt_libs @@ -246,8 +241,6 @@ else() endforeach() target_link_libraries(external_qt INTERFACE - desktop-app::external_jpeg - desktop-app::external_zlib cups ) else() @@ -313,6 +306,8 @@ else() ${qt_libs_list} $ $ + desktop-app::external_jpeg + desktop-app::external_zlib ) if (LINUX) @@ -378,8 +373,6 @@ else() endif() target_link_libraries(external_qt INTERFACE - desktop-app::external_jpeg - desktop-app::external_zlib ICE SM fontconfig From ae1d5ed04ff1284c439e2e51fb63d7b57d585a43 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 15 Dec 2020 18:34:28 +0400 Subject: [PATCH 13/17] Build Qt without libICE/libSM --- external/qt/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index e33d215..64031e2 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -373,8 +373,6 @@ else() endif() target_link_libraries(external_qt INTERFACE - ICE - SM fontconfig freetype EGL From 783efab5aa41efb2db8a162174e016a254021b7d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 15 Dec 2020 04:23:22 +0400 Subject: [PATCH 14/17] ffmpeg requires Xv for va-x11 now --- external/ffmpeg/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/external/ffmpeg/CMakeLists.txt b/external/ffmpeg/CMakeLists.txt index 027b4dd..ef900e5 100644 --- a/external/ffmpeg/CMakeLists.txt +++ b/external/ffmpeg/CMakeLists.txt @@ -68,6 +68,7 @@ else() va-drm va vdpau + Xv Xext Xfixes ) From 3d7edfc4ba27b27d18d55b79c618314d31065b13 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 20 Dec 2020 17:20:03 +0400 Subject: [PATCH 15/17] Add qt_static_plugins module --- external/qt/CMakeLists.txt | 2 + external/qt/qt_static_plugins/CMakeLists.txt | 43 +++++++++++++ .../qt_static_plugins/qt_static_plugins.cpp | 63 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 external/qt/qt_static_plugins/CMakeLists.txt create mode 100644 external/qt/qt_static_plugins/qt_static_plugins.cpp diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index 64031e2..1c004a1 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -7,6 +7,8 @@ add_library(external_qt INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_qt ALIAS external_qt) +add_subdirectory(qt_static_plugins) + if (DESKTOP_APP_USE_PACKAGED) target_link_libraries(external_qt INTERFACE diff --git a/external/qt/qt_static_plugins/CMakeLists.txt b/external/qt/qt_static_plugins/CMakeLists.txt new file mode 100644 index 0000000..09c96b6 --- /dev/null +++ b/external/qt/qt_static_plugins/CMakeLists.txt @@ -0,0 +1,43 @@ +# This file is part of Desktop App Toolkit, +# a set of libraries for developing nice desktop applications. +# +# For license and copyright information please follow this link: +# https://github.com/desktop-app/legal/blob/master/LEGAL + +add_library(external_qt_static_plugins OBJECT) +add_library(desktop-app::external_qt_static_plugins ALIAS external_qt_static_plugins) +init_target(external_qt_static_plugins "(external)") + +nice_target_sources(external_qt_static_plugins ${CMAKE_CURRENT_SOURCE_DIR} +PRIVATE + qt_static_plugins.cpp +) + +target_link_libraries(external_qt_static_plugins +PUBLIC + desktop-app::external_qt +) + +if (LINUX) + target_link_libraries(external_qt_static_plugins + PUBLIC + desktop-app::external_nimf_qt5 + desktop-app::external_qt5ct_support + ) + + if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) + target_link_libraries(external_qt_static_plugins + PUBLIC + desktop-app::external_fcitx_qt5 + desktop-app::external_fcitx5_qt5 + desktop-app::external_hime_qt + ) + endif() + + if (NOT DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION) + target_link_libraries(external_qt_static_plugins + PUBLIC + desktop-app::external_materialdecoration + ) + endif() +endif() diff --git a/external/qt/qt_static_plugins/qt_static_plugins.cpp b/external/qt/qt_static_plugins/qt_static_plugins.cpp new file mode 100644 index 0000000..8ac2094 --- /dev/null +++ b/external/qt/qt_static_plugins/qt_static_plugins.cpp @@ -0,0 +1,63 @@ +/* +This file is part of Desktop App Toolkit, +a set of libraries for developing nice desktop applications. + +For license and copyright information please follow this link: +https://github.com/desktop-app/legal/blob/master/LEGAL +*/ +#include + +#ifndef DESKTOP_APP_USE_PACKAGED +Q_IMPORT_PLUGIN(QWebpPlugin) + +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) +Q_IMPORT_PLUGIN(QJpegPlugin) +Q_IMPORT_PLUGIN(QGifPlugin) +#endif // Qt 5.8.0 + +#ifdef Q_OS_WIN +Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) +#elif defined Q_OS_MAC // Q_OS_WIN +Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) +Q_IMPORT_PLUGIN(QGenericEnginePlugin) +#elif defined Q_OS_UNIX // Q_OS_WIN | Q_OS_MAC +Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) +Q_IMPORT_PLUGIN(QGenericEnginePlugin) +Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) +Q_IMPORT_PLUGIN(QSvgIconPlugin) +#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION +Q_IMPORT_PLUGIN(QConnmanEnginePlugin) +Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin) +Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) +Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin) +#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION +#ifndef DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION +Q_IMPORT_PLUGIN(QWaylandEglClientBufferPlugin) +Q_IMPORT_PLUGIN(QWaylandIviShellIntegrationPlugin) +Q_IMPORT_PLUGIN(QWaylandWlShellIntegrationPlugin) +Q_IMPORT_PLUGIN(QWaylandXdgShellIntegrationPlugin) +Q_IMPORT_PLUGIN(QWaylandBradientDecorationPlugin) +Q_IMPORT_PLUGIN(QWaylandIntegrationPlugin) +Q_IMPORT_PLUGIN(QWaylandEglPlatformIntegrationPlugin) +#endif // !DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION +#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_UNIX +#endif // !DESKTOP_APP_USE_PACKAGED + +#if defined Q_OS_UNIX && !defined Q_OS_MAC +#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY +Q_IMPORT_PLUGIN(NimfInputContextPlugin) +#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION +Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) +Q_IMPORT_PLUGIN(QFcitx5PlatformInputContextPlugin) +Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin) +#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION +#ifndef DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION +Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin) +#endif // !DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION +#endif // !DESKTOP_APP_USE_PACKAGED || DESKTOP_APP_USE_PACKAGED_LAZY + +#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES +Q_IMPORT_PLUGIN(Qt5CTPlatformThemePlugin) +Q_IMPORT_PLUGIN(Qt5CTStylePlugin) +#endif // !DESKTOP_APP_USE_PACKAGED || DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES +#endif // Q_OS_UNIX && !Q_OS_MAC From 98410c7064b7b73c708df97ba04b53d33398ec08 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 20 Dec 2020 17:20:58 +0400 Subject: [PATCH 16/17] Remove unneeded automative shell --- external/qt/CMakeLists.txt | 1 - external/qt/qt_static_plugins/qt_static_plugins.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index 1c004a1..a416202 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -268,7 +268,6 @@ else() 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 plugins/wayland-graphics-integration-client/${qt_lib_prefix}qt-plugin-wayland-egl diff --git a/external/qt/qt_static_plugins/qt_static_plugins.cpp b/external/qt/qt_static_plugins/qt_static_plugins.cpp index 8ac2094..349651e 100644 --- a/external/qt/qt_static_plugins/qt_static_plugins.cpp +++ b/external/qt/qt_static_plugins/qt_static_plugins.cpp @@ -33,7 +33,6 @@ Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin) #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION #ifndef DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION Q_IMPORT_PLUGIN(QWaylandEglClientBufferPlugin) -Q_IMPORT_PLUGIN(QWaylandIviShellIntegrationPlugin) Q_IMPORT_PLUGIN(QWaylandWlShellIntegrationPlugin) Q_IMPORT_PLUGIN(QWaylandXdgShellIntegrationPlugin) Q_IMPORT_PLUGIN(QWaylandBradientDecorationPlugin) From a81345a28d407fb5acd5267ec6afa1864f4e8d5b Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 20 Dec 2020 17:21:36 +0400 Subject: [PATCH 17/17] Use CMAKE_DL_LIBS in external_qt --- external/qt/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/qt/CMakeLists.txt b/external/qt/CMakeLists.txt index a416202..9ebb64d 100644 --- a/external/qt/CMakeLists.txt +++ b/external/qt/CMakeLists.txt @@ -381,8 +381,8 @@ else() xcb X11 X11-xcb - dl glib-2.0 + ${CMAKE_DL_LIBS} pthread ) endif()