Skip to content

Commit

Permalink
[1.5>1.6] [MERGE #3135 @obastemur] xplat: Improve ICU fallback condit…
Browse files Browse the repository at this point in the history
…ions

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.
  • Loading branch information
obastemur committed Jun 13, 2017
2 parents e265ab1 + 9638711 commit b438fc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,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()
Expand Down
12 changes: 11 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b438fc7

Please sign in to comment.