From e97ab1bcb5734ec2bf56d0e80db4e680aedd2ef9 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 13 Jan 2022 00:06:00 +0400 Subject: [PATCH] Use bundled fonts and rlottie by default since they're patched --- external/rlottie/CMakeLists.txt | 22 ++++++---------------- options.cmake | 7 +++++++ variables.cmake | 8 ++------ 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/external/rlottie/CMakeLists.txt b/external/rlottie/CMakeLists.txt index a2029e7..04ce0f4 100644 --- a/external/rlottie/CMakeLists.txt +++ b/external/rlottie/CMakeLists.txt @@ -7,27 +7,17 @@ add_library(external_rlottie INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_rlottie ALIAS external_rlottie) -if (DESKTOP_APP_USE_PACKAGED) +if (DESKTOP_APP_USE_PACKAGED_RLOTTIE) find_package(rlottie QUIET) - if (rlottie_FOUND) target_link_libraries(external_rlottie INTERFACE rlottie::rlottie) - else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(RLOTTIE IMPORTED_TARGET rlottie) - - if (RLOTTIE_FOUND) - target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE) - endif() - endif() - - if (rlottie_FOUND OR RLOTTIE_FOUND) - target_compile_definitions(external_rlottie - INTERFACE - DESKTOP_APP_USE_PACKAGED_RLOTTIE - ) return() endif() + + find_package(PkgConfig REQUIRED) + pkg_check_modules(RLOTTIE REQUIRED IMPORTED_TARGET rlottie) + target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE) + return() endif() add_library(external_rlottie_bundled STATIC) diff --git a/options.cmake b/options.cmake index 66fb670..9e9822d 100644 --- a/options.cmake +++ b/options.cmake @@ -64,6 +64,13 @@ if (DESKTOP_APP_USE_PACKAGED_FONTS) ) endif() +if (DESKTOP_APP_USE_PACKAGED_RLOTTIE) + target_compile_definitions(common_options + INTERFACE + DESKTOP_APP_USE_PACKAGED_RLOTTIE + ) +endif() + if (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "") target_compile_definitions(common_options INTERFACE diff --git a/variables.cmake b/variables.cmake index dcbdcff..4d6c9bd 100644 --- a/variables.cmake +++ b/variables.cmake @@ -23,6 +23,8 @@ 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_FONTS "Use preinstalled fonts instead of bundled patched ones." OFF) +option(DESKTOP_APP_USE_PACKAGED_RLOTTIE "Find rlottie using CMake instead of bundled patched one." 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}) @@ -36,12 +38,6 @@ else() set(DESKTOP_APP_MAC_ARCH "x86_64;arm64" CACHE STRING "Target macOS arch. (macOS only)") endif() -set(dont_bundle_fonts 0) -if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY) - set(dont_bundle_fonts 1) -endif() -option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${dont_bundle_fonts}) - set(add_hunspell_library 0) if ((WIN32 OR (LINUX AND NOT DESKTOP_APP_USE_ENCHANT)