Skip to content

Commit

Permalink
Remove setting ICUCORE for macOS in System.Globalization.Native CMake…
Browse files Browse the repository at this point in the history
… config

Follow-up to dotnet#39833.

We don't link against ICU on macOS but load it via `dlopen()` at runtime and compilation uses headers from homebrew.
That means `HAVE_SET_MAX_VARIABLE` and `HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS` will always be defined and we don't need the ICUCORE variable.
  • Loading branch information
akoeplinger committed Jul 24, 2020
1 parent b5293d4 commit 78bff93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ if(CLR_CMAKE_TARGET_UNIX)
endif()

if(CLR_CMAKE_TARGET_OSX)
find_library(ICUCORE icucore)
if(ICUCORE STREQUAL ICUCORE-NOTFOUND)
message(FATAL_ERROR "Cannot find libicucore, skipping build for System.Globalization.Native. .NET globalization is not expected to function.")
return()
endif()
add_definitions(-DOSX_ICU_LIBRARY_PATH=\"/usr/lib/libicucore.dylib\")
add_definitions(-DU_DISABLE_RENAMING)
else()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(CLR_CMAKE_TARGET_ANDROID)
if(CLR_CMAKE_TARGET_ANDROID OR CLR_CMAKE_TARGET_OSX)
set(HAVE_SET_MAX_VARIABLE 1)
set(HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS 1)
else()
Expand All @@ -13,11 +13,7 @@ else()
int main(void) { enum UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
" HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)

if(CLR_CMAKE_TARGET_OSX)
set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE})
else()
set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N})
endif()
set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N})

check_symbol_exists(
ucol_setMaxVariable
Expand Down

0 comments on commit 78bff93

Please sign in to comment.