-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
914: build: add -rdynamic to fix stack traces
- Loading branch information
1 parent
590704a
commit b823eac
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
include(CheckCXXCompilerFlag) | ||
|
||
if(POLICY CMP0056) | ||
# Honor link flags in try_compile() source-file signature. | ||
cmake_policy(SET CMP0056 NEW) | ||
endif() | ||
|
||
# This is written because cmake does not support `check_linker_flag` until 3.18 | ||
function(check_linker_flag flag out_var) | ||
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") | ||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") | ||
check_cxx_compiler_flag("" ${out_var}) | ||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include(CheckLinkerFlag) | ||
|
||
check_linker_flag(-rdynamic LINK_SUPPORTS_RDYNAMIC) | ||
|
||
if (LINK_SUPPORT_RDYNAMIC) | ||
target_link_options(${VIRTUAL_TRANSPORT_LIBRARY} INTERFACE -rdynamic) | ||
endif() |