diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 1460cf9..28eebaf 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -17,6 +17,9 @@ add_checked_subdirectory(crash_reports) if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) add_checked_subdirectory(dbusmenu_qt) endif() +if (LINUX) + add_checked_subdirectory(dispatch) +endif() add_checked_subdirectory(expected) if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) add_checked_subdirectory(fcitx_qt5) diff --git a/external/dispatch/CMakeLists.txt b/external/dispatch/CMakeLists.txt new file mode 100644 index 0000000..27b9d02 --- /dev/null +++ b/external/dispatch/CMakeLists.txt @@ -0,0 +1,70 @@ +# 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 + +set(dispatch_loc ${third_party_loc}/dispatch) +set(dispatch_prefix ${CMAKE_CURRENT_BINARY_DIR}/dispatch-prefix) +set(dispatch_binary_dir ${dispatch_prefix}/src/dispatch-build) + +if (DESKTOP_APP_USE_PACKAGED) + find_library(DISPATCH_LIBRARIES dispatch) + find_path(DISPATCH_INCLUDE_DIRS dispatch/dispatch.h) +endif() + +if (NOT DISPATCH_LIBRARIES OR NOT DISPATCH_INCLUDE_DIRS) + execute_process( + COMMAND ${CMAKE_COMMAND} ${dispatch_loc} + -B ${dispatch_binary_dir} + -GNinja + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_C_COMPILER=clang + -DCMAKE_CXX_COMPILER=clang++ + -DBUILD_SHARED_LIBS=OFF + -DBUILD_TESTING=OFF + ) + + execute_process( + COMMAND ${CMAKE_COMMAND} --build ${dispatch_binary_dir} + ) + + if (NOT EXISTS ${dispatch_binary_dir}/src/libdispatch.a) + if (DESKTOP_APP_SPECIAL_TARGET) + message(FATAL_ERROR "Dispatch build failed") + else() + return() + endif() + endif() +endif() + +add_library(external_dispatch INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_dispatch ALIAS external_dispatch) + +if (DESKTOP_APP_USE_PACKAGED AND DISPATCH_LIBRARIES AND DISPATCH_INCLUDE_DIRS) + target_include_directories(external_dispatch SYSTEM INTERFACE ${DISPATCH_INCLUDE_DIRS}) + target_link_libraries(external_dispatch INTERFACE ${DISPATCH_LIBRARIES}) + return() +endif() + +add_library(external_dispatch_bundled STATIC IMPORTED) + +set_target_properties(external_dispatch_bundled PROPERTIES + IMPORTED_LOCATION "${dispatch_binary_dir}/src/libdispatch.a" +) + +target_include_directories(external_dispatch_bundled SYSTEM +INTERFACE + ${dispatch_loc} +) + +target_link_libraries(external_dispatch_bundled +INTERFACE + ${dispatch_binary_dir}/src/BlocksRuntime/libBlocksRuntime.a + pthread +) + +target_link_libraries(external_dispatch +INTERFACE + external_dispatch_bundled +) diff --git a/external/ffmpeg/CMakeLists.txt b/external/ffmpeg/CMakeLists.txt index 70d46d5..50acdd4 100644 --- a/external/ffmpeg/CMakeLists.txt +++ b/external/ffmpeg/CMakeLists.txt @@ -16,34 +16,14 @@ if (DESKTOP_APP_USE_PACKAGED) pkg_check_modules(SWSCALE REQUIRED IMPORTED_TARGET libswscale) pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) - if (DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC) - target_include_directories(external_ffmpeg SYSTEM - INTERFACE - ${AVCODEC_STATIC_INCLUDE_DIRS} - ${AVFORMAT_STATIC_INCLUDE_DIRS} - ${AVUTIL_STATIC_INCLUDE_DIRS} - ${SWSCALE_STATIC_INCLUDE_DIRS} - ${SWRESAMPLE_STATIC_INCLUDE_DIRS} - ) - - target_link_static_libraries(external_ffmpeg IGNORE_NONEXISTING - INTERFACE - ${AVCODEC_STATIC_LIBRARIES} - ${AVFORMAT_STATIC_LIBRARIES} - ${AVUTIL_STATIC_LIBRARIES} - ${SWSCALE_STATIC_LIBRARIES} - ${SWRESAMPLE_STATIC_LIBRARIES} - ) - else() - target_link_libraries(external_ffmpeg - INTERFACE - PkgConfig::AVCODEC - PkgConfig::AVFORMAT - PkgConfig::AVUTIL - PkgConfig::SWSCALE - PkgConfig::SWRESAMPLE - ) - endif() + target_link_libraries(external_ffmpeg + INTERFACE + PkgConfig::AVCODEC + PkgConfig::AVFORMAT + PkgConfig::AVUTIL + PkgConfig::SWSCALE + PkgConfig::SWRESAMPLE + ) else() target_include_directories(external_ffmpeg SYSTEM INTERFACE diff --git a/external/jemalloc/CMakeLists.txt b/external/jemalloc/CMakeLists.txt index 014dc4f..13227f5 100644 --- a/external/jemalloc/CMakeLists.txt +++ b/external/jemalloc/CMakeLists.txt @@ -23,46 +23,46 @@ if (DESKTOP_APP_USE_PACKAGED) ${JEMALLOC_LINK_LIBRARIES} -Wl,--as-needed ) + return() endif() endif() -if (NOT JEMALLOC_FOUND) - add_library(external_jemalloc_bundled STATIC IMPORTED GLOBAL) - set(jemalloc_loc ${third_party_loc}/jemalloc) +add_library(external_jemalloc_bundled STATIC IMPORTED) - include(ExternalProject) - ExternalProject_Add(jemalloc - SOURCE_DIR ${jemalloc_loc} - CONFIGURE_COMMAND cd "${jemalloc_loc}" && export EXTRA_CFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && export EXTRA_CXXFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && CC=clang CXX=clang++ ./autogen.sh - INSTALL_COMMAND : - BUILD_IN_SOURCE 1 - BUILD_BYPRODUCTS ${jemalloc_loc}/lib/libjemalloc.a - ) +include(ExternalProject) +ExternalProject_Add(jemalloc + URL ${third_party_loc}/jemalloc + CONFIGURE_COMMAND cd "" && export EXTRA_CFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && export EXTRA_CXXFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && CC=clang CXX=clang++ ./autogen.sh + BUILD_IN_SOURCE 1 + STEP_TARGETS build + EXCLUDE_FROM_ALL TRUE + BUILD_BYPRODUCTS /lib/libjemalloc.a +) - file(MAKE_DIRECTORY "${jemalloc_loc}/include") +ExternalProject_Get_property(jemalloc SOURCE_DIR) +file(MAKE_DIRECTORY "${SOURCE_DIR}/include") - set_target_properties(external_jemalloc_bundled PROPERTIES - IMPORTED_LOCATION "${jemalloc_loc}/lib/libjemalloc.a" - ) +set_target_properties(external_jemalloc_bundled PROPERTIES + IMPORTED_LOCATION "${SOURCE_DIR}/lib/libjemalloc.a" +) - target_include_directories(external_jemalloc_bundled SYSTEM - INTERFACE - ${jemalloc_loc}/include - ) +target_include_directories(external_jemalloc_bundled SYSTEM +INTERFACE + ${SOURCE_DIR}/include +) - target_link_libraries(external_jemalloc_bundled - INTERFACE - ${CMAKE_DL_LIBS} - pthread - ) +target_link_libraries(external_jemalloc_bundled +INTERFACE + ${CMAKE_DL_LIBS} + pthread +) - add_dependencies(external_jemalloc_bundled jemalloc) +add_dependencies(external_jemalloc_bundled jemalloc-build) - target_link_libraries(external_jemalloc - INTERFACE - -Wl,--whole-archive - $ - -Wl,--no-whole-archive - external_jemalloc_bundled - ) -endif() +target_link_libraries(external_jemalloc +INTERFACE + -Wl,--whole-archive + $ + -Wl,--no-whole-archive + external_jemalloc_bundled +) diff --git a/external/kwayland/CMakeLists.txt b/external/kwayland/CMakeLists.txt index c6bff7b..7f90b9f 100644 --- a/external/kwayland/CMakeLists.txt +++ b/external/kwayland/CMakeLists.txt @@ -4,38 +4,76 @@ # For license and copyright information please follow this link: # https://github.com/desktop-app/legal/blob/master/LEGAL -if (DESKTOP_APP_USE_PACKAGED) - add_library(external_kwayland INTERFACE IMPORTED GLOBAL) - add_library(desktop-app::external_kwayland ALIAS external_kwayland) +add_library(external_kwayland INTERFACE IMPORTED GLOBAL) +add_library(desktop-app::external_kwayland ALIAS external_kwayland) - find_package(KF5Wayland REQUIRED) - target_link_libraries(external_kwayland INTERFACE KF5::WaylandClient) -else() - add_library(external_kwayland STATIC IMPORTED GLOBAL) - add_library(desktop-app::external_kwayland ALIAS external_kwayland) +if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_QT6) + find_package(KF5Wayland) - find_library(KWAYLAND_LIBRARY libKF5WaylandClient.a) - set_target_properties(external_kwayland PROPERTIES - IMPORTED_LOCATION "${KWAYLAND_LIBRARY}" - ) - - target_include_directories(external_kwayland SYSTEM - INTERFACE - /usr/local/include/KF5 - /usr/local/include/KF5/KWayland/Client - ) - - if (DESKTOP_APP_QT6) - set(qtconcurrent_loc ${qt_loc}/lib/libQt6Concurrent.a) - else() - set(qtconcurrent_loc ${qt_loc}/lib/libQt5Concurrent.a) + if (KF5Wayland_FOUND) + target_link_libraries(external_kwayland INTERFACE KF5::WaylandClient) + return() endif() +endif() - target_link_libraries(external_kwayland +add_library(external_kwayland_bundled STATIC IMPORTED) + +set(kwayland_patch_command) +if (DESKTOP_APP_QT6) + set(kwayland_patch_command PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/kwayland-qt6.patch) +endif() + +include(ExternalProject) +ExternalProject_Add(kwayland + URL ${third_party_loc}/kwayland + CMAKE_GENERATOR Ninja + CMAKE_ARGS + -DCMAKE_BUILD_TYPE=Release + -DBUILD_SHARED_LIBS=OFF + -DBUILD_TESTING=OFF + ${kwayland_patch_command} + BUILD_COMMAND ${CMAKE_COMMAND} --build --target KF5WaylandClient + STEP_TARGETS build + EXCLUDE_FROM_ALL TRUE + BUILD_BYPRODUCTS /lib/libKF5WaylandClient.a +) + +ExternalProject_Get_property(kwayland SOURCE_DIR) +ExternalProject_Get_property(kwayland BINARY_DIR) + +file(MAKE_DIRECTORY "${SOURCE_DIR}/src/client") +file(MAKE_DIRECTORY "${BINARY_DIR}/src/client") + +set_target_properties(external_kwayland_bundled PROPERTIES + IMPORTED_LOCATION "${BINARY_DIR}/lib/libKF5WaylandClient.a" +) + +target_include_directories(external_kwayland_bundled SYSTEM +INTERFACE + ${SOURCE_DIR}/src/client + ${BINARY_DIR}/src/client +) + +target_link_libraries(external_kwayland_bundled +INTERFACE + desktop-app::external_qt +) + +if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig REQUIRED) + pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client) + target_link_libraries(external_kwayland_bundled INTERFACE PkgConfig::WAYLAND_CLIENT) +else() + target_link_libraries(external_kwayland_bundled INTERFACE desktop-app::linux_wayland_helper $ - ${qtconcurrent_loc} - desktop-app::external_qt ) endif() + +add_dependencies(external_kwayland_bundled kwayland-build) + +target_link_libraries(external_kwayland +INTERFACE + external_kwayland_bundled +) diff --git a/external/kwayland/kwayland-qt6.patch b/external/kwayland/kwayland-qt6.patch new file mode 100644 index 0000000..1d40589 --- /dev/null +++ b/external/kwayland/kwayland-qt6.patch @@ -0,0 +1,99 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b478cde..5f19170 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,10 +31,8 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KWAYLAND + + # Dependencies + set(REQUIRED_QT_VERSION 5.15.2) +-find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Private) +-find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent WaylandClient) +- +-find_package(QtWaylandScanner REQUIRED) ++find_package(Qt6Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Private) ++find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent WaylandClient) + + find_package(Wayland 1.15 COMPONENTS Client Server) + set_package_properties(Wayland PROPERTIES +@@ -69,14 +67,8 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02) + # Subdirectories + ecm_install_po_files_as_qm(po) + +-find_package(QtWaylandScanner REQUIRED) + add_subdirectory(src) + +-if (BUILD_TESTING) +- add_subdirectory(autotests) +- add_subdirectory(tests) +-endif() +- + # create a Config.cmake and a ConfigVersion.cmake file and install them + set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Wayland") + +diff --git a/KF5WaylandConfig.cmake.in b/KF5WaylandConfig.cmake.in +index ef20432..1294d3e 100644 +--- a/KF5WaylandConfig.cmake.in ++++ b/KF5WaylandConfig.cmake.in +@@ -1,7 +1,7 @@ + @PACKAGE_INIT@ + + include(CMakeFindDependencyMacro) +-find_dependency(Qt5Gui @REQUIRED_QT_VERSION@) ++find_dependency(Qt6Gui @REQUIRED_QT_VERSION@) + + include("${CMAKE_CURRENT_LIST_DIR}/KF5WaylandTargets.cmake") + @PACKAGE_INCLUDE_QCHTARGETS@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index c8a307c..e6497c8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,6 +1,4 @@ + add_subdirectory(client) +-add_subdirectory(server) +-add_subdirectory(tools) + + ecm_qt_install_logging_categories( + EXPORT KWAYLAND +@@ -36,7 +34,7 @@ if(BUILD_QCH) + ${KWaylandServer_APIDOX_SRCS} + MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" + LINK_QCHS +- Qt5Gui_QCH ++ Qt6Gui_QCH + INCLUDE_DIRS + ${KWaylandClient_APIDOX_BUILD_INCLUDE_DIRS} + ${KWaylandServer_APIDOX_BUILD_INCLUDE_DIRS} +diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt +index b7ec33a..efb390a 100644 +--- a/src/client/CMakeLists.txt ++++ b/src/client/CMakeLists.txt +@@ -3,7 +3,7 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII) + remove_definitions(-DQT_NO_CAST_TO_ASCII) + + # needed to access QPA +-include_directories(SYSTEM ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) ++include_directories(SYSTEM ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) + + set(CLIENT_LIB_SRCS + appmenu.cpp +@@ -256,10 +256,17 @@ ecm_generate_export_header(KF5WaylandClient + + target_include_directories(KF5WaylandClient INTERFACE "$") + ++target_include_directories(KF5WaylandClient ++ PRIVATE ${Wayland_Client_INCLUDE_DIR} ++ ${Qt6Concurrent_INCLUDE_DIRS} ++) ++ ++get_target_property(Qt6Concurrent_LIBRARIES Qt6::Concurrent IMPORTED_LOCATION) ++ + target_link_libraries(KF5WaylandClient +- PUBLIC Qt5::Gui +- PRIVATE Wayland::Client +- Qt5::Concurrent ++ PUBLIC Qt6::Gui ++ PRIVATE ${Wayland_Client_LIBRARY} ++ ${Qt6Concurrent_LIBRARIES} + ) + + set_target_properties(KF5WaylandClient PROPERTIES VERSION ${KWAYLAND_VERSION} diff --git a/external/minizip/CMakeLists.txt b/external/minizip/CMakeLists.txt index 8a65649..b9f8596 100644 --- a/external/minizip/CMakeLists.txt +++ b/external/minizip/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(desktop-app::external_minizip ALIAS external_minizip) if (DESKTOP_APP_USE_PACKAGED) find_package(PkgConfig REQUIRED) - pkg_check_modules(MINIZIP IMPORTED_TARGET minizip) + pkg_check_modules(MINIZIP IMPORTED_TARGET minizip<2.0.0) if (MINIZIP_FOUND) target_link_libraries(external_minizip INTERFACE PkgConfig::MINIZIP) diff --git a/external/qr_code_generator/CMakeLists.txt b/external/qr_code_generator/CMakeLists.txt index 07905a6..aaa733c 100644 --- a/external/qr_code_generator/CMakeLists.txt +++ b/external/qr_code_generator/CMakeLists.txt @@ -9,7 +9,7 @@ add_library(desktop-app::external_qr_code_generator ALIAS external_qr_code_gener if (DESKTOP_APP_USE_PACKAGED) find_library(QRCODE_LIBRARIES NAMES qrcodegencpp) - find_path(QRCODE_INCLUDE_DIRS QrCode.hpp PATH_SUFFIXES qrcodegencpp qrcodegen) + find_path(QRCODE_INCLUDE_DIRS qrcodegen.hpp PATH_SUFFIXES qrcodegencpp qrcodegen) if (QRCODE_LIBRARIES AND QRCODE_INCLUDE_DIRS) target_include_directories(external_qr_code_generator SYSTEM INTERFACE ${QRCODE_INCLUDE_DIRS}) @@ -26,12 +26,8 @@ if (NOT QRCODE_LIBRARIES OR NOT QRCODE_INCLUDE_DIRS) nice_target_sources(external_qr_code_generator_bundled ${qr_src} PRIVATE - BitBuffer.cpp - BitBuffer.hpp - QrCode.cpp - QrCode.hpp - QrSegment.cpp - QrSegment.hpp + qrcodegen.cpp + qrcodegen.hpp ) target_include_directories(external_qr_code_generator_bundled diff --git a/external/qt/package.cmake b/external/qt/package.cmake index 7a778d8..c5b9491 100644 --- a/external/qt/package.cmake +++ b/external/qt/package.cmake @@ -6,7 +6,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED) if (DESKTOP_APP_QT6) - set(qt_version 6.2.0) + set(qt_version 6.2.2) else() set(qt_version 5.15.2) endif() diff --git a/external/xxhash/CMakeLists.txt b/external/xxhash/CMakeLists.txt index b3a721b..93e3ffd 100644 --- a/external/xxhash/CMakeLists.txt +++ b/external/xxhash/CMakeLists.txt @@ -8,23 +8,21 @@ add_library(external_xxhash INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_xxhash ALIAS external_xxhash) if (DESKTOP_APP_USE_PACKAGED) - find_library(XXHASH_LIBRARY xxhash) - find_path(XXHASH_INCLUDE_DIRS xxhash.h) + find_package(PkgConfig REQUIRED) + pkg_check_modules(XXHASH IMPORTED_TARGET libxxhash) - if (XXHASH_LIBRARY AND XXHASH_INCLUDE_DIRS) - target_include_directories(external_xxhash SYSTEM INTERFACE ${XXHASH_INCLUDE_DIRS}) - target_link_libraries(external_xxhash INTERFACE ${XXHASH_LIBRARY}) + if (XXHASH_FOUND) + target_link_libraries(external_xxhash INTERFACE PkgConfig::XXHASH) + return() endif() endif() -if (NOT XXHASH_LIBRARY OR NOT XXHASH_INCLUDE_DIRS) - target_include_directories(external_xxhash SYSTEM - INTERFACE - ${third_party_loc}/xxHash - ) +target_include_directories(external_xxhash SYSTEM +INTERFACE + ${third_party_loc}/xxHash +) - target_compile_definitions(external_xxhash - INTERFACE - XXH_INLINE_ALL - ) -endif() +target_compile_definitions(external_xxhash +INTERFACE + XXH_INLINE_ALL +) diff --git a/linux_wayland_helper/linux_wayland_helper.cpp b/linux_wayland_helper/linux_wayland_helper.cpp index 67c9f0c..9fb3b1f 100644 --- a/linux_wayland_helper/linux_wayland_helper.cpp +++ b/linux_wayland_helper/linux_wayland_helper.cpp @@ -12,6 +12,7 @@ #include #define LOAD_SYMBOL(handle, func) LoadSymbol(handle, #func, func) +#define LOAD_SYMBOL_SILENT(handle, func) LoadSymbol(handle, #func, func, true) namespace Wayland { namespace { @@ -95,6 +96,13 @@ struct wl_proxy *(*wl_proxy_marshal_array_constructor_versioned)( union wl_argument *args, const struct wl_interface *interface, uint32_t version); +struct wl_proxy *(*wl_proxy_marshal_array_flags)( + struct wl_proxy *proxy, + uint32_t opcode, + const struct wl_interface *interface, + uint32_t version, + uint32_t flags, + union wl_argument *args); uint32_t (*wl_proxy_get_id)(struct wl_proxy *proxy); const void *(*wl_proxy_get_listener)(struct wl_proxy *proxy); @@ -189,11 +197,15 @@ bool LoadLibrary(Handle &handle, const char *name) { } template -inline bool LoadSymbol(const Handle &handle, const char *name, Function &func) { +inline bool LoadSymbol( + const Handle &handle, + const char *name, + Function &func, + bool silent = false) { func = handle ? reinterpret_cast(dlsym(handle.get(), name)) : nullptr; - if (const auto error = dlerror()) { + if (const auto error = dlerror(); error && !silent) { std::cerr << error << std::endl; } return (func != nullptr); @@ -204,7 +216,7 @@ bool Resolve() { auto egl = Handle(); auto cursor = Handle(); auto client = Handle(); - return LoadLibrary(egl, "libwayland-egl.so.1") + const auto required = LoadLibrary(egl, "libwayland-egl.so.1") && LOAD_SYMBOL(egl, wl_egl_window_create) && LOAD_SYMBOL(egl, wl_egl_window_destroy) && LOAD_SYMBOL(egl, wl_egl_window_resize) @@ -247,6 +259,8 @@ bool Resolve() { && LOAD_SYMBOL(client, wl_proxy_marshal_array_constructor_versioned) && LOAD_SYMBOL(client, wl_proxy_get_id) && LOAD_SYMBOL(client, wl_proxy_get_listener); + LOAD_SYMBOL_SILENT(client, wl_proxy_marshal_array_flags); + return required; }(); return loaded; } @@ -536,6 +550,24 @@ struct wl_proxy *wl_proxy_marshal_array_constructor_versioned( version); } +struct wl_proxy *wl_proxy_marshal_array_flags( + struct wl_proxy *proxy, + uint32_t opcode, + const struct wl_interface *interface, + uint32_t version, + uint32_t flags, + union wl_argument *args) { + Expects(W::wl_proxy_marshal_array_flags != nullptr); + + return W::wl_proxy_marshal_array_flags( + proxy, + opcode, + interface, + version, + flags, + args); +} + uint32_t wl_proxy_get_id(struct wl_proxy *proxy) { Expects(W::wl_proxy_get_id != nullptr); @@ -619,4 +651,51 @@ struct wl_proxy *wl_proxy_marshal_constructor_versioned( version); } +struct wl_proxy *wl_proxy_marshal_flags( + struct wl_proxy *proxy, + uint32_t opcode, + const struct wl_interface *interface, + uint32_t version, + uint32_t flags, + ...) { + union wl_argument args[W::WL_CLOSURE_MAX_ARGS]; + va_list ap; + + va_start(ap, flags); + + // wl_proxy { wl_object { wl_interface *, ... }, ... } + struct wl_object *object = (struct wl_object*)proxy; + struct wl_interface *i = *((struct wl_interface**)object); + W::wl_argument_from_va_list( + i->methods[opcode].signature, + args, + W::WL_CLOSURE_MAX_ARGS, + ap); + + va_end(ap); + + if (W::wl_proxy_marshal_array_flags == nullptr) { + const auto result = wl_proxy_marshal_array_constructor_versioned( + proxy, + opcode, + args, + interface, + version); + + if (flags & WL_MARSHAL_FLAG_DESTROY) { + wl_proxy_destroy(proxy); + } + + return result; + } + + return wl_proxy_marshal_array_flags( + proxy, + opcode, + interface, + version, + flags, + args); +} + } // extern "C" diff --git a/target_link_static_libraries.cmake b/target_link_static_libraries.cmake index d8fac55..2aa2875 100644 --- a/target_link_static_libraries.cmake +++ b/target_link_static_libraries.cmake @@ -12,34 +12,14 @@ function(target_link_static_libraries target_name) set(private_libs "") set(public_libs "") set(interface_libs "") - set(ignore_nonexisting 0) - set(ignored_libs "") foreach (entry ${list}) if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE") set(writing_now ${entry}) - elseif (${entry} STREQUAL "IGNORE_NONEXISTING") - set(ignore_nonexisting 1) else() find_library(static_lib_${entry} lib${entry}.a) set(full_path "${static_lib_${entry}}") if (${full_path} STREQUAL static_lib_${entry}-NOTFOUND) - if (ignore_nonexisting) - if (NOT entry IN_LIST ignored_libs) - message(VERBOSE "Could not find static library lib${entry}.a, using shared one...") - list(APPEND ignored_libs ${entry}) - endif() - if (APPLE) - find_library(shared_lib_${entry} lib${entry}.dylib) - set(full_path "${shared_lib_${entry}}") - if (${full_path} STREQUAL shared_lib_${entry}-NOTFOUND) - message(FATAL_ERROR "Could not find shared library lib${entry}.dylib") - endif() - else() - set(full_path ${entry}) - endif() - else() - message(FATAL_ERROR "Could not find static library lib${entry}.a") - endif() + message(FATAL_ERROR "Could not find static library lib${entry}.a") endif() if ("${writing_now}" STREQUAL "PRIVATE") list(APPEND private_libs ${full_path}) diff --git a/variables.cmake b/variables.cmake index a8ce960..82876fd 100644 --- a/variables.cmake +++ b/variables.cmake @@ -23,7 +23,6 @@ option(DESKTOP_APP_DISABLE_X11_INTEGRATION "Disable all code for X11 integration option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF) option(DESKTOP_APP_USE_ALLOCATION_TRACER "Use simple allocation tracer (Linux only)." OFF) option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF) -option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF) option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." OFF) option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target}) option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})