This commit is contained in:
xiaoyifang 2024-11-19 16:13:31 +08:00
parent d839b3488d
commit a8403dcf29
2 changed files with 9 additions and 11 deletions

View file

@ -39,11 +39,11 @@ jobs:
libogg \
libvorbis \
libzim \
icu4c \
lzip \
ninja \
opencc \
xapian
brew install icu4c --force
- name: Install eb
run: |
git clone https://github.com/xiaoyifang/eb.git

View file

@ -79,15 +79,13 @@ endif ()
if (WITH_ZIM)
if (APPLE)
# brew list
execute_process(
COMMAND brew --prefix libzim
OUTPUT_VARIABLE LIBZIM_PATH
if (EXISTS /opt/homebrew)
set(ENV{PKG_CONFIG_PATH} "/opt/homebrew/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
endif()
)
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 /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)