Skip to content

Commit a8aec35

Browse files
committed
[Linux] Enable build IDs.
We should use build IDs on Linux so that we can identify the built artefacts, and also so that we can match them up with debug information should we choose to separate it. rdar://130582882
1 parent e0c3868 commit a8aec35

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ endif()
2323

2424
include(SwiftSupport)
2525
include(GNUInstallDirs)
26+
include(CheckLinkerFlag)
27+
28+
check_linker_flag(Swift "SHELL:-Xlinker --build-id=sha1" LINKER_SUPPORTS_BUILD_ID)
2629

2730
add_library(XCTest
2831
Sources/XCTest/Private/WallClockTimeMetric.swift
@@ -79,6 +82,10 @@ set_target_properties(XCTest PROPERTIES
7982
Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift
8083
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/swift)
8184

85+
if(LINKER_SUPPORTS_BUILD_ID)
86+
target_link_options(XCTest PRIVATE "LINKER:--build-id=sha1")
87+
endif()
88+
8289

8390
if(ENABLE_TESTING)
8491
enable_testing()

0 commit comments

Comments
 (0)