@@ -6,45 +6,49 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
6
6
add_definitions (-DPIC=1)
7
7
add_definitions (-DBIT64=1)
8
8
9
- set (ICU_HOMEBREW_LIB_PATH "/usr/local/opt/icu4c/lib" )
10
9
set (ICU_HOMEBREW_INC_PATH "/usr/local/opt/icu4c/include" )
11
10
11
+ find_path (UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH} )
12
+ if (UTYPES_H STREQUAL UTYPES_H-NOTFOUND )
13
+ message (FATAL_ERROR "Cannont find utypes.h, try installing libicu-dev (or the appropriate package for your platform)" )
14
+ return ()
15
+ endif ()
16
+
12
17
if (NOT CLR_CMAKE_PLATFORM_DARWIN)
13
- find_library (ICUUC NAMES icuuc PATHS ${ICU_HOMEBREW_LIB_PATH} )
18
+ find_library (ICUUC icuuc)
14
19
if (ICUUC STREQUAL ICUUC-NOTFOUND )
15
20
message (FATAL_ERROR "Cannot find libicuuc, try installing libicu-dev (or the appropriate package for your platform)" )
16
21
return ()
17
22
endif ()
18
23
19
- find_library (ICUI18N NAMES icui18n PATHS ${ICU_HOMEBREW_LIB_PATH} )
24
+ find_library (ICUI18N icui18n)
20
25
if (ICUI18N STREQUAL ICUI18N-NOTFOUND )
21
26
message (FATAL_ERROR "Cannot find libicui18n, try installing libicu-dev (or the appropriate package for your platform)" )
22
27
return ()
23
28
endif ()
24
29
30
+ set (CMAKE_REQUIRED_INCLUDES ${ICU_HOMEBREW_INC_PATH} )
31
+ CHECK_CXX_SOURCE_COMPILES("
32
+ #include <unicode/udat.h>
33
+ int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
34
+ " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
35
+
36
+ if (HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
37
+ add_definitions (-DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS=1)
38
+ endif (HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
39
+
25
40
else ()
26
- find_library (ICUCORE NAMES icucore)
41
+
42
+ find_library (ICUCORE icucore)
27
43
if (ICUI18N STREQUAL ICUCORE-NOTFOUND )
28
44
message (FATAL_ERROR "Cannot find libicucore, skipping build for System.Globalization.Native. .NET globalization is not expected to function." )
29
45
return ()
30
46
endif ()
31
- endif ()
32
-
33
- find_path (UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH} )
34
- if (UTYPES_H STREQUAL UTYPES_H-NOTFOUND )
35
- message (FATAL_ERROR "Cannont find utypes.h, try installing libicu-dev (or the appropriate package for your platform)" )
36
- return ()
37
- endif ()
38
47
39
- set (CMAKE_REQUIRED_INCLUDES ${ICU_HOMEBREW_INC_PATH} )
40
- CHECK_CXX_SOURCE_COMPILES("
41
- #include <unicode/dtfmtsym.h>
42
- int main() { DateFormatSymbols::DtWidthType e = DateFormatSymbols::DtWidthType::SHORT; }
43
- " HAVE_DTWIDTHTYPE_SHORT)
48
+ # libicucore supports UDAT_STANDALONE_SHORTER_WEEKDAYS
49
+ add_definitions (-DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS=1)
44
50
45
- if (HAVE_DTWIDTHTYPE_SHORT)
46
- add_definitions (-DHAVE_DTWIDTHTYPE_SHORT=1)
47
- endif (HAVE_DTWIDTHTYPE_SHORT)
51
+ endif ()
48
52
49
53
add_compile_options (-fPIC)
50
54
0 commit comments