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 (dotnet#39900)

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.

* PR feedback

Co-authored-by: Adeel Mujahid <[email protected]>
  • Loading branch information
2 people authored and Jacksondr5 committed Aug 10, 2020
1 parent 0c45c49 commit a99d4cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ 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(-DOSX_ICU_LIBRARY_PATH="/usr/lib/libicucore.dylib")
add_definitions(-DU_DISABLE_RENAMING)
else()
find_library(ICUUC icuuc)
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 a99d4cd

Please sign in to comment.