Skip to content

Commit

Permalink
hidden linking for apple mobile, other left as is
Browse files Browse the repository at this point in the history
  • Loading branch information
matouskozak committed Mar 8, 2024
1 parent 0b865a8 commit 4f1fc7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
7 changes: 4 additions & 3 deletions src/native/libs/System.Globalization.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4f1fc7f

Please sign in to comment.