Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,24 @@ function(clr_unknown_arch)
message(FATAL_ERROR "Only AMD64, ARM and I386 are supported")
endfunction()

if(INTL_ICU_SH)
unset(INTL_ICU_SH CACHE) # don't cache
add_definitions(-DINTL_ICU=1)
set(ICU_INTL_ENABLED 1)
endif()

if(ICU_INCLUDE_PATH)
add_definitions(-DHAS_REAL_ICU=1)
set(ICU_CC_PATH "${ICU_INCLUDE_PATH}/../lib/")
find_library(ICUUC icuuc PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
if(ICU_INTL_ENABLED)
find_library(ICU18 icui18n PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
# icu header files are either located under the same folder or i18n is under a relative path
# TODO (unlikely): shall we add `--icu-intl` to build.sh ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we making a distinction between --icu-intl (as in the path we want to specify) versus --intl-icu (not present on CMake builds, terminology used on Windows builds i.e. /p:IntlICU=true), versus --with-intl?

I agree this is not likely necessary and can be skipped for now.

set(ICU_INCLUDE_PATH
"${ICU_INCLUDE_PATH}"
"${ICU_INCLUDE_PATH}/../i18n/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me. @jackhorton look good to you?

endif()
if(ICUUC)
message("-- found ICU libs: ${ICU_CC_PATH}")
find_library(ICUDATA icudata PATHS ${ICU_CC_PATH} NO_DEFAULT_PATH)
Expand Down Expand Up @@ -185,12 +198,17 @@ endif()

if(CC_TARGET_OS_LINUX OR CC_TARGET_OS_ANDROID)
if(NOT ICULIB)
if(NOT NO_ICU_PATH_GIVEN)
if(NOT CC_EMBED_ICU)
set(ICULIB "icuuc")
if(NOT NO_ICU_PATH_GIVEN)
if(NOT CC_EMBED_ICU)
set(ICULIB "icuuc")
if(ICU_INTL_ENABLED)
set(ICULIB
"${ICULIB}"
"icui18n")
endif()
endif()
add_definitions(-DHAS_REAL_ICU=1)
endif()
add_definitions(-DHAS_REAL_ICU=1)
endif()
endif()

set(CLR_CMAKE_PLATFORM_LINUX 1)
Expand Down Expand Up @@ -394,12 +412,6 @@ else()
set(BuildJIT 1)
endif()

if(INTL_ICU_SH)
unset(INTL_ICU_SH CACHE) # don't cache
add_definitions(-DINTL_ICU=1)
set(IntlICU 1)
endif()

if(WITHOUT_FEATURES_SH)
add_definitions(${WITHOUT_FEATURES_SH})
unset(WITHOUT_FEATURES_SH CACHE) # don't cache
Expand Down