File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ include(CheckCSourceCompiles)
122122include (CheckFunctionExists)
123123include (CheckIncludeFiles)
124124include (CheckLibraryExists)
125+ include (CheckLinkerFlag)
125126include (CheckSymbolExists)
126127include (GNUInstallDirs)
127128include (CTest)
@@ -175,6 +176,8 @@ option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Th
175176set (DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE} )
176177
177178
179+ check_linker_flag(C "LINKER:--build-id=sha1" LINKER_SUPPORTS_BUILD_ID)
180+
178181check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
179182if (_GNU_SOURCE)
180183 set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE)
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ endif()
2222set_target_properties (BlocksRuntime PROPERTIES
2323 POSITION_INDEPENDENT_CODE TRUE )
2424
25+ if (LINKER_SUPPORTS_BUILD_ID)
26+ target_link_options (BlocksRuntime PRIVATE "LINKER:--build-id=sha1" )
27+ endif ()
28+
2529add_library (BlocksRuntime::BlocksRuntime ALIAS BlocksRuntime)
2630
2731install (FILES Block.h
Original file line number Diff line number Diff line change @@ -178,6 +178,10 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
178178 set_target_properties (dispatch PROPERTIES INSTALL_RPATH "$ORIGIN" )
179179endif ()
180180
181+ if (LINKER_SUPPORTS_BUILD_ID)
182+ target_link_options (dispatch PRIVATE "LINKER:--build-id=sha1" )
183+ endif ()
184+
181185if (ENABLE_SWIFT)
182186 add_subdirectory (swift)
183187endif ()
You can’t perform that action at this time.
0 commit comments