From f02fcd5be91412d663d273da9f14f4647a83e89b Mon Sep 17 00:00:00 2001 From: Gabriel Dantas Date: Thu, 31 Oct 2024 09:51:51 -0300 Subject: [PATCH] define icu paths --- .github/workflows/cmake-multi-platform.yml | 16 ++++++++++++++++ CMakeLists.txt | 7 ++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 55ba947..fbb115b 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -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 @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff570f..6765e49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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