From b392c83e86cfaeb38891278bc0bd41ee0bedf390 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Tue, 10 Sep 2024 05:52:23 -0400 Subject: [PATCH] fix: ensure icu4c are copied to app bundle on macOS (#1762) by explictly linking it --- cmake/Deps_Unix.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index ff842dec..e9de93ea 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -83,6 +83,12 @@ endif () if (WITH_ZIM) pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim) target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM) + if (APPLE) + # For some reason, icu4c as transitive dependency of libzim may not be copied into app bundle, + # so we directly depends on it to help macdeployqt or whatever + pkg_check_modules(BREW_ICU_FOR_LIBZIM_FORCE_LINK REQUIRED IMPORTED_TARGET icu-i18n icu-uc) + target_link_libraries(${GOLDENDICT} PUBLIC PkgConfig::BREW_ICU_FOR_LIBZIM_FORCE_LINK) + endif () endif () if (USE_SYSTEM_FMT)