fix: [macos] icudata missed in the final executable dependencies

This commit is contained in:
xiaoyifang 2024-11-18 13:47:49 +08:00
parent 652da8e1ec
commit db8fa45825
2 changed files with 4 additions and 17 deletions

View file

@ -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 \

View file

@ -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 ()