Skip to content

[Linux] Enable build-ids. #4995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ else()
endif()
FetchContent_MakeAvailable(SwiftFoundationICU SwiftFoundation)

include(CheckLinkerFlag)

check_linker_flag(C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID)

# Precompute module triple for installation
if(NOT SwiftFoundation_MODULE_TRIPLE)
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
Expand Down
4 changes: 4 additions & 0 deletions Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,9 @@ set_target_properties(Foundation PROPERTIES
target_link_libraries(Foundation PUBLIC
swiftDispatch)

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(Foundation PRIVATE "LINKER:--build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation)
_foundation_install_target(Foundation)
4 changes: 4 additions & 0 deletions Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ target_link_options(FoundationNetworking PRIVATE
set_target_properties(FoundationNetworking PROPERTIES
INSTALL_RPATH "$ORIGIN")

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(FoundationNetworking PRIVATE "LINKER:--build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)
_foundation_install_target(FoundationNetworking)
4 changes: 4 additions & 0 deletions Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@ target_link_options(FoundationXML PRIVATE
set_target_properties(FoundationXML PROPERTIES
INSTALL_RPATH "$ORIGIN")

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(FoundationXML PRIVATE "LINKER:--build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
_foundation_install_target(FoundationXML)