summaryrefslogtreecommitdiff
path: root/src/corefx
diff options
context:
space:
mode:
authorEric Erhardt <eric.erhardt@microsoft.com>2016-01-07 16:14:16 -0600
committerEric Erhardt <eric.erhardt@microsoft.com>2016-01-08 13:19:00 -0600
commitba0691fb3c74c75702abc45286884570731a84ca (patch)
tree79bc3e3bf9ccf229754f692b4aad1db7506260ea /src/corefx
parent2a52c91242ca3010803e85f5857b977f470a0510 (diff)
downloadcoreclr-ba0691fb3c74c75702abc45286884570731a84ca.tar.gz
coreclr-ba0691fb3c74c75702abc45286884570731a84ca.tar.bz2
coreclr-ba0691fb3c74c75702abc45286884570731a84ca.zip
Convert System.Globalization.Native to use a configure.cmake and .h.in files.
Diffstat (limited to 'src/corefx')
-rw-r--r--src/corefx/System.Globalization.Native/CMakeLists.txt17
-rw-r--r--src/corefx/System.Globalization.Native/calendarData.cpp4
-rw-r--r--src/corefx/System.Globalization.Native/config.h.in3
-rw-r--r--src/corefx/System.Globalization.Native/configure.cmake10
4 files changed, 17 insertions, 17 deletions
diff --git a/src/corefx/System.Globalization.Native/CMakeLists.txt b/src/corefx/System.Globalization.Native/CMakeLists.txt
index 71b5c039d2..0b4e402106 100644
--- a/src/corefx/System.Globalization.Native/CMakeLists.txt
+++ b/src/corefx/System.Globalization.Native/CMakeLists.txt
@@ -1,6 +1,5 @@
project(System.Globalization.Native)
-include(CheckCXXSourceCompiles)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -29,28 +28,16 @@ if(NOT CLR_CMAKE_PLATFORM_DARWIN)
endif()
set(CMAKE_REQUIRED_INCLUDES ${ICU_HOMEBREW_INC_PATH})
- CHECK_CXX_SOURCE_COMPILES("
- #include <unicode/udat.h>
- int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
- " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
-
- if(HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
- add_definitions(-DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS=1)
- endif(HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
-
else()
-
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()
-
- # libicucore supports UDAT_STANDALONE_SHORTER_WEEKDAYS
- add_definitions(-DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS=1)
-
endif()
+include(configure.cmake)
+
add_compile_options(-fPIC)
set(NATIVEGLOBALIZATION_SOURCES
diff --git a/src/corefx/System.Globalization.Native/calendarData.cpp b/src/corefx/System.Globalization.Native/calendarData.cpp
index f223e6836d..3bb6dfedac 100644
--- a/src/corefx/System.Globalization.Native/calendarData.cpp
+++ b/src/corefx/System.Globalization.Native/calendarData.cpp
@@ -7,6 +7,7 @@
#include <string.h>
#include <vector>
+#include "config.h"
#include "locale.hpp"
#include "holders.h"
@@ -577,8 +578,7 @@ extern "C" int32_t EnumCalendarInfo(EnumCalendarInfoCallback callback,
case SuperShortDayNames:
// UDAT_STANDALONE_SHORTER_WEEKDAYS was added in ICU 51, and CentOS 7 currently uses ICU 50.
// fallback to UDAT_STANDALONE_NARROW_WEEKDAYS in that case.
-
-#ifdef HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS
+#if HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS
return EnumSymbols(locale, calendarId, UDAT_STANDALONE_SHORTER_WEEKDAYS, 1, callback, context);
#else
return EnumSymbols(locale, calendarId, UDAT_STANDALONE_NARROW_WEEKDAYS, 1, callback, context);
diff --git a/src/corefx/System.Globalization.Native/config.h.in b/src/corefx/System.Globalization.Native/config.h.in
new file mode 100644
index 0000000000..c8e097f4fe
--- /dev/null
+++ b/src/corefx/System.Globalization.Native/config.h.in
@@ -0,0 +1,3 @@
+#pragma once
+
+#cmakedefine01 HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS
diff --git a/src/corefx/System.Globalization.Native/configure.cmake b/src/corefx/System.Globalization.Native/configure.cmake
new file mode 100644
index 0000000000..f1cc9c63dc
--- /dev/null
+++ b/src/corefx/System.Globalization.Native/configure.cmake
@@ -0,0 +1,10 @@
+include(CheckCXXSourceCompiles)
+
+CHECK_CXX_SOURCE_COMPILES("
+ #include <unicode/udat.h>
+ int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
+" HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)