From a8403dcf29e88d11dc29e806e4d4d4e4bc6d0597 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Tue, 19 Nov 2024 16:13:31 +0800 Subject: [PATCH] 1 --- .github/workflows/Release-all.yml | 4 ++-- cmake/Deps_Unix.cmake | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Release-all.yml b/.github/workflows/Release-all.yml index 19b1bf94..0b45f548 100644 --- a/.github/workflows/Release-all.yml +++ b/.github/workflows/Release-all.yml @@ -39,11 +39,11 @@ jobs: libogg \ libvorbis \ libzim \ + icu4c \ lzip \ ninja \ opencc \ - xapian - brew install icu4c --force + xapian - name: Install eb run: | git clone https://github.com/xiaoyifang/eb.git diff --git a/cmake/Deps_Unix.cmake b/cmake/Deps_Unix.cmake index ee81572e..40aaa66f 100644 --- a/cmake/Deps_Unix.cmake +++ b/cmake/Deps_Unix.cmake @@ -79,15 +79,13 @@ endif () if (WITH_ZIM) if (APPLE) - # 执行 brew list 命令并捕获输出 - execute_process( - COMMAND brew --prefix libzim - OUTPUT_VARIABLE LIBZIM_PATH - - ) - message(STATUS "zim path:${LIBZIM_PATH}") - # ICU from homebrew is "key-only", we need to manually prioritize it -> see `brew info icu4c` - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBZIM_PATH}/lib/pkgconfig") + if (EXISTS /opt/homebrew) + set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") + endif() + + if (EXISTS /usr/local) + set(ENV{PKG_CONFIG_PATH} "/usr/local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") + endif() endif () pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim) target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)