From ff7b02722daf587d2bc60dc70eacb49599904785 Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Wed, 23 Oct 2024 20:02:54 +0900 Subject: [PATCH] Fix icu4c build path in macOS Signed-off-by: HyukWoo Park --- .github/workflows/analysis-actions.yml | 4 ++-- .github/workflows/es-actions.yml | 11 +++++++---- build/target.cmake | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analysis-actions.yml b/.github/workflows/analysis-actions.yml index 7f7c7b642..8188345d7 100644 --- a/.github/workflows/analysis-actions.yml +++ b/.github/workflows/analysis-actions.yml @@ -26,7 +26,7 @@ jobs: tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - name: Build env: - BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_CODE_CACHE=ON -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja + BUILD_OPTIONS: -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_CODE_CACHE=ON -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja run: | export PATH=$GITHUB_WORKSPACE/cov-analysis-linux64/bin:$PATH cmake -H. -Bout/coverity_scan $BUILD_OPTIONS @@ -59,7 +59,7 @@ jobs: sudo apt-get install -y pypy ninja-build libicu-dev gcovr - name: Build x64 env: - BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_COVERAGE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja + BUILD_OPTIONS: -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_COVERAGE=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja run: | cmake -H. -Bout/coverage $BUILD_OPTIONS ninja -Cout/coverage diff --git a/.github/workflows/es-actions.yml b/.github/workflows/es-actions.yml index 60f710bc2..5bba35392 100644 --- a/.github/workflows/es-actions.yml +++ b/.github/workflows/es-actions.yml @@ -5,6 +5,7 @@ on: branches: [ master ] pull_request: branches: [ master ] + workflow_dispatch: env: RUNNER: tools/run-tests.py @@ -33,7 +34,7 @@ jobs: - name: Install Packages run: | brew update - brew install cmake ninja pkg-config icu4c + brew install cmake ninja pkg-config icu4c@75 - name: Build x64 env: BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja @@ -41,7 +42,8 @@ jobs: # check cpu sysctl -a | grep machdep.cpu # add icu path to pkg_config_path - export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH" + brew --prefix icu4c@75 + export PKG_CONFIG_PATH="/usr/local/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH" cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS ninja -Cout/debug/ $RUNNER --engine="./out/debug/escargot" new-es @@ -59,7 +61,7 @@ jobs: - name: Install Packages run: | brew update - brew install cmake ninja pkg-config icu4c + brew install cmake ninja pkg-config icu4c@75 - name: Build arm64 env: BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja @@ -67,7 +69,8 @@ jobs: # check cpu sysctl -a | grep machdep.cpu # add icu path to pkg_config_path - export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH" + brew --prefix icu4c@75 + export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH" cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS ninja -Cout/debug/ $RUNNER --engine="./out/debug/escargot" new-es diff --git a/build/target.cmake b/build/target.cmake index d2a6d1cb9..6145a6082 100644 --- a/build/target.cmake +++ b/build/target.cmake @@ -157,6 +157,8 @@ ELSEIF (${ESCARGOT_HOST} STREQUAL "darwin") IF ((NOT ${ESCARGOT_ARCH} STREQUAL "x64") AND (NOT ${ESCARGOT_ARCH} STREQUAL "aarch64")) MESSAGE (FATAL_ERROR ${ESCARGOT_ARCH} " is unsupported") ENDIF() + # recent macOS supports only ICU version 75 that requires c++17 or above + SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -std=c++17) SET (ESCARGOT_LDFLAGS -lpthread -Wl,-dead_strip) SET (ESCARGOT_BUILD_64BIT_LARGE ON) # bdwgc mac cannot support pthread_getattr_np