diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2c881a36e..df177bd4d1d 100644 --- a/CMakeLists.txt +++ b/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/build.sh b/build.sh index d83fc5e560b..eca2863f15f 100755 --- a/build.sh +++ b/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)