Skip to content

Commit ca62b48

Browse files
committed
[MERGE #3822 @obastemur] xplat: fix the path for i18n
Merge pull request #3822 from obastemur:icui18n
2 parents ad64dbd + 42d0a7b commit ca62b48

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

CMakeLists.txt

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,24 @@ function(clr_unknown_arch)
126126
message(FATAL_ERROR "Only AMD64, ARM and I386 are supported")
127127
endfunction()
128128

129+
if(INTL_ICU_SH)
130+
unset(INTL_ICU_SH CACHE) # don't cache
131+
add_definitions(-DINTL_ICU=1)
132+
set(ICU_INTL_ENABLED 1)
133+
endif()
134+
129135
if(ICU_INCLUDE_PATH)
130136
add_definitions(-DHAS_REAL_ICU=1)
131137
set(ICU_CC_PATH "${ICU_INCLUDE_PATH}/../lib/")
132138
find_library(ICUUC icuuc PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
133-
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
139+
if(ICU_INTL_ENABLED)
140+
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
141+
# icu header files are either located under the same folder or i18n is under a relative path
142+
# TODO (unlikely): shall we add `--icu-intl` to build.sh ?
143+
set(ICU_INCLUDE_PATH
144+
"${ICU_INCLUDE_PATH}"
145+
"${ICU_INCLUDE_PATH}/../i18n/")
146+
endif()
134147
if(ICUUC)
135148
message("-- found ICU libs: ${ICU_CC_PATH}")
136149
find_library(ICUDATA icudata PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
@@ -185,12 +198,17 @@ endif()
185198

186199
if(CC_TARGET_OS_LINUX OR CC_TARGET_OS_ANDROID)
187200
if(NOT ICULIB)
188-
if(NOT NO_ICU_PATH_GIVEN)
189-
if(NOT CC_EMBED_ICU)
190-
set(ICULIB "icuuc")
201+
if(NOT NO_ICU_PATH_GIVEN)
202+
if(NOT CC_EMBED_ICU)
203+
set(ICULIB "icuuc")
204+
if(ICU_INTL_ENABLED)
205+
set(ICULIB
206+
"${ICULIB}"
207+
"icui18n")
208+
endif()
209+
endif()
210+
add_definitions(-DHAS_REAL_ICU=1)
191211
endif()
192-
add_definitions(-DHAS_REAL_ICU=1)
193-
endif()
194212
endif()
195213

196214
set(CLR_CMAKE_PLATFORM_LINUX 1)
@@ -394,12 +412,6 @@ else()
394412
set(BuildJIT 1)
395413
endif()
396414

397-
if(INTL_ICU_SH)
398-
unset(INTL_ICU_SH CACHE) # don't cache
399-
add_definitions(-DINTL_ICU=1)
400-
set(IntlICU 1)
401-
endif()
402-
403415
if(WITHOUT_FEATURES_SH)
404416
add_definitions(${WITHOUT_FEATURES_SH})
405417
unset(WITHOUT_FEATURES_SH CACHE) # don't cache

0 commit comments

Comments
 (0)