From 083bf13949aac3340a931c0c78100a436e58bf6f Mon Sep 17 00:00:00 2001 From: chakrabot Date: Wed, 14 Jun 2017 03:02:51 -0700 Subject: [PATCH] [Merge Microsoft/Chakracore@96387111d7] [MERGE #3135 @obastemur] xplat: Improve ICU fallback conditions Merge pull request #3135 from obastemur:dont_fall node-chakracore was silently falling back to `no-icu`. Couple of changes to be more proactive when a custom ICU path is given. Similarly, do not fallback to `no-icu` when custom ICU path is given. --- deps/chakrashim/core/CMakeLists.txt | 4 +++- deps/chakrashim/core/build.sh | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/deps/chakrashim/core/CMakeLists.txt b/deps/chakrashim/core/CMakeLists.txt index 0e2c881a36e..df177bd4d1d 100644 --- a/deps/chakrashim/core/CMakeLists.txt +++ b/deps/chakrashim/core/CMakeLists.txt @@ -194,7 +194,9 @@ elseif(CC_TARGET_OS_OSX) -DPLATFORM_UNIX ) - if(NOT ICULIB) + # in case ICU path was given but it doesn't exist, build script will fail. + # so, fallback only if ICU path wasn't given + if(NOT ICU_INCLUDE_PATH) set(NO_ICU_PATH_GIVEN 1) message("-- Couldn't find ICU. Falling back to --no-icu build") endif() diff --git a/deps/chakrashim/core/build.sh b/deps/chakrashim/core/build.sh index d83fc5e560b..eca2863f15f 100644 --- a/deps/chakrashim/core/build.sh +++ b/deps/chakrashim/core/build.sh @@ -184,7 +184,17 @@ while [[ $# -gt 0 ]]; do --icu=*) ICU_PATH=$1 - ICU_PATH="-DICU_INCLUDE_PATH_SH=${ICU_PATH:6}" + ICU_PATH="${ICU_PATH:6}" + if [[ ! -d ${ICU_PATH} ]]; then + if [[ -d "${CHAKRACORE_DIR}/${ICU_PATH}" ]]; then + ICU_PATH="${CHAKRACORE_DIR}/${ICU_PATH}" + else + # if ICU_PATH is given, do not fallback to no-icu + echo "!!! couldn't find ICU at $ICU_PATH" + exit 1 + fi + fi + ICU_PATH="-DICU_INCLUDE_PATH_SH=${ICU_PATH}" ;; --libs-only)