File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ else()
7474endif ()
7575FetchContent_MakeAvailable(SwiftFoundationICU SwiftFoundation)
7676
77+ include (CheckLinkerFlag)
78+
79+ check_linker_flag(C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID)
80+
7781# Precompute module triple for installation
7882if (NOT SwiftFoundation_MODULE_TRIPLE)
7983 set (module_triple_command "${CMAKE_Swift_COMPILER} " -print-target -info)
Original file line number Diff line number Diff line change @@ -171,5 +171,9 @@ set_target_properties(Foundation PROPERTIES
171171target_link_libraries (Foundation PUBLIC
172172 swiftDispatch)
173173
174+ if (LINKER_SUPPORTS_BUILD_ID)
175+ target_link_options (Foundation PRIVATE "LINKER:--build-id=sha1" )
176+ endif ()
177+
174178set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation)
175179_foundation_install_target(Foundation)
Original file line number Diff line number Diff line change @@ -71,5 +71,9 @@ target_link_options(FoundationNetworking PRIVATE
7171set_target_properties (FoundationNetworking PROPERTIES
7272 INSTALL_RPATH "$ORIGIN" )
7373
74+ if (LINKER_SUPPORTS_BUILD_ID)
75+ target_link_options (FoundationNetworking PRIVATE "LINKER:--build-id=sha1" )
76+ endif ()
77+
7478set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)
7579_foundation_install_target(FoundationNetworking)
Original file line number Diff line number Diff line change @@ -46,5 +46,9 @@ target_link_options(FoundationXML PRIVATE
4646set_target_properties (FoundationXML PROPERTIES
4747 INSTALL_RPATH "$ORIGIN" )
4848
49+ if (LINKER_SUPPORTS_BUILD_ID)
50+ target_link_options (FoundationXML PRIVATE "LINKER:--build-id=sha1" )
51+ endif ()
52+
4953set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
5054_foundation_install_target(FoundationXML)
You can’t perform that action at this time.
0 commit comments