diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index bb2b47bdbeaf3b..08b90567eb288b 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -421,12 +421,14 @@ if(NOT DISABLE_SHARED_LIBS) # to avoid a conflict we rename the import library with the .import.lib suffix set_target_properties(monosgen-shared PROPERTIES IMPORT_SUFFIX ".import.lib") endif() - target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) add_linker_flag(-Wl,-L${ICU_LIBDIR}) add_linker_flag(-Wl,-hidden-licuuc) add_linker_flag(-Wl,-hidden-licui18n) add_linker_flag(-Wl,-hidden-licudata) + else() + target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) endif() if(ICU_LDFLAGS) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index d838b1695d9ca4..1fcaf0b6bd583c 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -66,15 +66,16 @@ set(NATIVEGLOBALIZATION_SOURCES if (DEFINED CMAKE_ICU_DIR) include_directories(${CMAKE_ICU_DIR}/include) - link_libraries(${CMAKE_ICU_DIR}/lib/libicuuc.a ${CMAKE_ICU_DIR}/lib/libicui18n.a ${CMAKE_ICU_DIR}/lib/libicudata.a) - link_libraries(stdc++) - if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_linker_flag(-Wl,-L${CMAKE_ICU_DIR}/lib) add_linker_flag(-Wl,-hidden-licuuc) add_linker_flag(-Wl,-hidden-licui18n) add_linker_flag(-Wl,-hidden-licudata) + else() + link_libraries(${CMAKE_ICU_DIR}/lib/libicuuc.a ${CMAKE_ICU_DIR}/lib/libicui18n.a ${CMAKE_ICU_DIR}/lib/libicudata.a) endif() + + link_libraries(stdc++) endif() if (CMAKE_USE_PTHREADS)