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()
74
74
endif ()
75
75
FetchContent_MakeAvailable (SwiftFoundationICU SwiftFoundation )
76
76
77
+ include (CheckLinkerFlag )
78
+
79
+ check_linker_flag (C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID )
80
+
77
81
# Precompute module triple for installation
78
82
if (NOT SwiftFoundation_MODULE_TRIPLE )
79
83
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
171
171
target_link_libraries (Foundation PUBLIC
172
172
swiftDispatch )
173
173
174
+ if (LINKER_SUPPORTS_BUILD_ID )
175
+ target_link_options (Foundation PRIVATE "LINKER:--build-id=sha1" )
176
+ endif ()
177
+
174
178
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation )
175
179
_foundation_install_target (Foundation )
Original file line number Diff line number Diff line change @@ -71,5 +71,9 @@ target_link_options(FoundationNetworking PRIVATE
71
71
set_target_properties (FoundationNetworking PROPERTIES
72
72
INSTALL_RPATH "$ORIGIN" )
73
73
74
+ if (LINKER_SUPPORTS_BUILD_ID )
75
+ target_link_options (FoundationNetworking PRIVATE "LINKER:--build-id=sha1" )
76
+ endif ()
77
+
74
78
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking )
75
79
_foundation_install_target (FoundationNetworking )
Original file line number Diff line number Diff line change @@ -46,5 +46,9 @@ target_link_options(FoundationXML PRIVATE
46
46
set_target_properties (FoundationXML PROPERTIES
47
47
INSTALL_RPATH "$ORIGIN" )
48
48
49
+ if (LINKER_SUPPORTS_BUILD_ID )
50
+ target_link_options (FoundationXML PRIVATE "LINKER:--build-id=sha1" )
51
+ endif ()
52
+
49
53
set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML )
50
54
_foundation_install_target (FoundationXML )
You can’t perform that action at this time.
0 commit comments