project(System.Globalization.Native)
-include(CheckCXXSourceCompiles)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
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
#include <string.h>
#include <vector>
+#include "config.h"
#include "locale.hpp"
#include "holders.h"
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);
--- /dev/null
+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)