Skip to content

Commit a7e8352

Browse files
authored
Merge pull request #34546 from mikeash/no-warn-inits
[CMake] Pass -no_warn_inits to the linker to silence warnings about global initializers
2 parents 6f73933 + e4add55 commit a7e8352

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,10 @@ function(_add_swift_target_library_single target name)
12911291
endif()
12921292
endif()
12931293
endif()
1294+
1295+
# Silence warnings about global initializers. We already have clang
1296+
# emitting warnings about global initializers when it compiles the code.
1297+
list(APPEND swiftlib_link_flags_all "-Xlinker -no_warn_inits")
12941298
endif()
12951299
target_link_libraries(${target} PRIVATE
12961300
${link_libraries})

0 commit comments

Comments
 (0)