Jelajahi Sumber

xplat: pre-check ICU path and help correcting

Make sure ICU path exists and support relative paths. Keep build from no-icu fallback in case custom path is given
Oguz Bastemur 8 tahun lalu
induk
melakukan
8bdba0939f
1 mengubah file dengan 11 tambahan dan 1 penghapusan
  1. 11 1
      build.sh

+ 11 - 1
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)