File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
2424set (CMAKE_C_IMPLICIT_LINK_DIRECTORIES "" )
2525set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "" )
2626
27+ set (CMAKE_C_VISIBILITY_PRESET hidden)
28+ set (CMAKE_CXX_VISIBILITY_PRESET hidden)
29+ set (CMAKE_VISIBILITY_INLINES_HIDDEN YES )
30+
2731if (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
2832 if (NOT "${CMAKE_C_COMPILER_ID} " MATCHES "Clang" )
2933 message (FATAL_ERROR "Building the swift runtime is not supported with ${CMAKE_C_COMPILER_ID} . Use the just-built clang instead." )
Original file line number Diff line number Diff line change @@ -48,13 +48,6 @@ if(CXX_SUPPORTS_EXIT_TIME_DESTRUCTORS_WARNING)
4848 list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-Wexit-time-destructors" )
4949endif ()
5050
51- # We don't want runtime C++ code to export symbols we didn't explicitly
52- # choose to.
53- check_cxx_compiler_flag("-fvisibility=hidden" CXX_SUPPORTS_DEFAULT_HIDDEN_VISIBILITY)
54- if (CXX_SUPPORTS_DEFAULT_HIDDEN_VISIBILITY)
55- list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-fvisibility=hidden" )
56- endif ()
57-
5851add_subdirectory (SwiftShims)
5952
6053if (SWIFT_BUILD_STDLIB)
Original file line number Diff line number Diff line change @@ -15,11 +15,7 @@ set(compile_flags
1515 # C++ code in the runtime and standard library should generally avoid
1616 # introducing static constructors or destructors.
1717 "-Wglobal-constructors"
18- "-Wexit-time-destructors"
19-
20- # We don't want runtime C++ code to export symbols we didn't explicitly
21- # choose to.
22- "-fvisibility=hidden" )
18+ "-Wexit-time-destructors" )
2319
2420
2521# Build the runtime with -Wall to catch, e.g., uninitialized variables
You can’t perform that action at this time.
0 commit comments