Skip to content

Commit

Permalink
define icu paths
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielNSD committed Oct 31, 2024
1 parent 21f0919 commit f02fcd5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ jobs:
- name: Configure CMake Unix
if: runner.os != 'Windows'
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
export ICU_ROOT=/usr/local/lib/icu/74.2
export CMAKE_PREFIX_PATH=$ICU_ROOT
export PKG_CONFIG_PATH=$ICU_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
export LDFLAGS="-L$ICU_ROOT/lib $LDFLAGS"
export CPPFLAGS="-I$ICU_ROOT/include $CPPFLAGS"
export PATH="$ICU_ROOT/bin:$PATH"
fi
cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }}
- name: Configure CMake Windows
Expand All @@ -169,6 +177,14 @@ jobs:
if: runner.os != 'Windows'
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
export ICU_ROOT=/usr/local/lib/icu/74.2
export CMAKE_PREFIX_PATH=$ICU_ROOT
export PKG_CONFIG_PATH=$ICU_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
export LDFLAGS="-L$ICU_ROOT/lib $LDFLAGS"
export CPPFLAGS="-I$ICU_ROOT/include $CPPFLAGS"
export PATH="$ICU_ROOT/bin:$PATH"
fi
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel 6
- name: Build Windows
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ if(APPLE)
# )

# Manually specify the include and library directories for ICU
# set(ICU_INCLUDE_DIR ${ICU_ROOT}/include)
# set(ICU_LIBRARY_DIR ${ICU_ROOT}/lib)
set(ICU_ROOT /usr/local/lib/icu/74.2)
set(ICU_INCLUDE_DIR ${ICU_ROOT}/include)
set(ICU_LIBRARY_DIR ${ICU_ROOT}/lib)

# Find and link ICU
# include_directories(${ICU_INCLUDE_DIR})
include_directories(${ICU_INCLUDE_DIR})
find_package(ICU REQUIRED COMPONENTS uc i18n data)

# Execute brew command to get the ONEDNN_ROOT
Expand Down

0 comments on commit f02fcd5

Please sign in to comment.