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 "")
24
24
set (CMAKE_C_IMPLICIT_LINK_DIRECTORIES "" )
25
25
set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "" )
26
26
27
+ set (CMAKE_C_VISIBILITY_PRESET hidden )
28
+ set (CMAKE_CXX_VISIBILITY_PRESET hidden )
29
+ set (CMAKE_VISIBILITY_INLINES_HIDDEN YES )
30
+
27
31
if (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER )
28
32
if (NOT "${CMAKE_C_COMPILER_ID} " MATCHES "Clang" )
29
33
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)
48
48
list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-Wexit-time-destructors" )
49
49
endif ()
50
50
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
-
58
51
add_subdirectory (SwiftShims )
59
52
60
53
if (SWIFT_BUILD_STDLIB )
Original file line number Diff line number Diff line change @@ -15,11 +15,7 @@ set(compile_flags
15
15
# C++ code in the runtime and standard library should generally avoid
16
16
# introducing static constructors or destructors.
17
17
"-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" )
23
19
24
20
25
21
# Build the runtime with -Wall to catch, e.g., uninitialized variables
You can’t perform that action at this time.
0 commit comments