From db8fa45825c6801df6b9891e385401d74075b155 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Mon, 18 Nov 2024 13:47:49 +0800 Subject: [PATCH] fix: [macos] icudata missed in the final executable dependencies --- .github/workflows/Release-all.yml | 2 +- cmake/Deps_Unix.cmake | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/Release-all.yml b/.github/workflows/Release-all.yml index a18dbd23..6e9f28a9 100644 --- a/.github/workflows/Release-all.yml +++ b/.github/workflows/Release-all.yml @@ -31,6 +31,7 @@ jobs: brew update - name: Install dependencies run: | + vcpkg install libzim brew install \ bzip2 \ create-dmg \ @@ -38,7 +39,6 @@ jobs: libiconv \ libogg \ libvorbis \ - libzim \ lzip \ ninja \ opencc \ diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index 11145bbf..5ecb8843 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -86,22 +86,9 @@ if (WITH_ZIM) target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM) if (APPLE) - # icu4c as transitive dependency of libzim may not be copied into app bundle, so we directly depends on it to assist macdeployqt - # Why such complexities: 1) System or XCode SDKS's icu exists 2) icu itself is depended by various stuffs and homebrew may need multiple versions of it - pkg_check_modules(BREW_ICU REQUIRED IMPORTED_TARGET icu-i18n icu-uc) - target_link_libraries(${GOLDENDICT} PUBLIC PkgConfig::BREW_ICU) - - # Verify icu <-> zim matches - message("Zim include dirs -> ${ZIM_INCLUDE_DIRS}") - message("Homebrew icu include dirs-> ${BREW_ICU_INCLUDE_DIRS}") - - list(GET BREW_ICU_INCLUDE_DIRS 0 ONE_OF_BREW_ICU_INCLUDE_DIR) - if (ONE_OF_BREW_ICU_INCLUDE_DIR IN_LIST ZIM_INCLUDE_DIRS) - message("ZIM OK!") - else () - message(FATAL_ERROR "!!!! ZIM <-> icu error -> check `brew info libzim` and `brew list libzim`") - endif () - # TODO: get rid of these 💩, how? + # 查找 ICU 库 + find_package(ICU REQUIRED COMPONENTS i18n data) + target_link_libraries(${GOLDENDICT} PUBLIC ${ICU_LIBRARIES}) endif () endif ()