Skip to content
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ include(CheckCSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckLinkerFlag)
include(CheckSymbolExists)
include(GNUInstallDirs)
include(CTest)
Expand Down Expand Up @@ -175,6 +176,8 @@ option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Th
set(DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE})


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

check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
if(_GNU_SOURCE)
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE)
Expand Down
4 changes: 4 additions & 0 deletions src/BlocksRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ endif()
set_target_properties(BlocksRuntime PROPERTIES
POSITION_INDEPENDENT_CODE TRUE)

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

add_library(BlocksRuntime::BlocksRuntime ALIAS BlocksRuntime)

install(FILES Block.h
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
set_target_properties(dispatch PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()

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

if(ENABLE_SWIFT)
add_subdirectory(swift)
endif()
Expand Down