summaryrefslogtreecommitdiff
path: root/src/corefx/System.Globalization.Native/CMakeLists.txt
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /src/corefx/System.Globalization.Native/CMakeLists.txt
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/corefx/System.Globalization.Native/CMakeLists.txt')
-rw-r--r--src/corefx/System.Globalization.Native/CMakeLists.txt40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/corefx/System.Globalization.Native/CMakeLists.txt b/src/corefx/System.Globalization.Native/CMakeLists.txt
index 3d9e392132..90f50671cd 100644
--- a/src/corefx/System.Globalization.Native/CMakeLists.txt
+++ b/src/corefx/System.Globalization.Native/CMakeLists.txt
@@ -14,7 +14,7 @@ if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
return()
endif()
-if(NOT CLR_CMAKE_PLATFORM_DARWIN)
+if (FEATURE_FIXED_ICU_VERSION AND NOT CLR_CMAKE_PLATFORM_DARWIN)
find_library(ICUUC icuuc)
if(ICUUC STREQUAL ICUUC-NOTFOUND)
message(FATAL_ERROR "Cannot find libicuuc, try installing libicu-dev (or the appropriate package for your platform)")
@@ -26,12 +26,16 @@ if(NOT CLR_CMAKE_PLATFORM_DARWIN)
message(FATAL_ERROR "Cannot find libicui18n, try installing libicu-dev (or the appropriate package for your platform)")
return()
endif()
-else()
+endif()
+
+if(CLR_CMAKE_PLATFORM_DARWIN)
find_library(ICUCORE icucore)
if(ICUI18N STREQUAL ICUCORE-NOTFOUND)
message(FATAL_ERROR "Cannot find libicucore, skipping build for System.Globalization.Native. .NET globalization is not expected to function.")
return()
endif()
+ # On Darwin, we always use the OS provided ICU
+ SET(FEATURE_FIXED_ICU_VERSION 1)
endif()
include(configure.cmake)
@@ -50,6 +54,12 @@ set(NATIVEGLOBALIZATION_SOURCES
timeZoneInfo.cpp
)
+if (NOT FEATURE_FIXED_ICU_VERSION)
+ list(APPEND NATIVEGLOBALIZATION_SOURCES
+ icushim.cpp
+ )
+endif()
+
include_directories(${UTYPES_H})
_add_library(System.Globalization.Native
@@ -60,11 +70,21 @@ _add_library(System.Globalization.Native
# Disable the "lib" prefix.
set_target_properties(System.Globalization.Native PROPERTIES PREFIX "")
+if (FEATURE_FIXED_ICU_VERSION)
+ add_definitions(-DFEATURE_FIXED_ICU_VERSION)
+endif()
+
if(NOT CLR_CMAKE_PLATFORM_DARWIN)
- target_link_libraries(System.Globalization.Native
- ${ICUUC}
- ${ICUI18N}
- )
+ if (FEATURE_FIXED_ICU_VERSION)
+ target_link_libraries(System.Globalization.Native
+ ${ICUUC}
+ ${ICUI18N}
+ )
+ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+ target_link_libraries(System.Globalization.Native
+ dl
+ )
+ endif()
else()
target_link_libraries(System.Globalization.Native
${ICUCORE}
@@ -73,5 +93,11 @@ else()
add_definitions(-DU_DISABLE_RENAMING=1)
endif()
+verify_dependencies(
+ System.Globalization.Native
+ "Verification failed. System.Globalization.Native.so has undefined dependencies. These are likely ICU APIs that need to be added to icushim.h."
+)
+
# add the install targets
-install_clr(System.Globalization.Native) \ No newline at end of file
+install_clr(System.Globalization.Native)
+