Skip to content

Commit

Permalink
Merge branch '1.0.0-914-fix-stack-trace' into 1.0.0-beta.10.4-propose…
Browse files Browse the repository at this point in the history
…d-update
  • Loading branch information
cz4rs committed Jan 5, 2021
2 parents 0ba1570 + 31bb621 commit fa1e493
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake-modules/CheckLinkerFlag.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
check_cxx_compiler_flag("" ${out_var})
endfunction()
11 changes: 11 additions & 0 deletions cmake/set_linker_flags.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include(CheckLinkerFlag)

check_linker_flag(-rdynamic LINKER_SUPPORTS_RDYNAMIC)

if (LINKER_SUPPORTS_RDYNAMIC)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
target_link_options(${VIRTUAL_TRANSPORT_LIBRARY} INTERFACE -rdynamic)
else()
target_link_libraries(${VIRTUAL_TRANSPORT_LIBRARY} INTERFACE -rdynamic)
endif()
endif()
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

include(../cmake/set_linker_flags.cmake)

install(
TARGETS ${VIRTUAL_TRANSPORT_LIBRARY}
Expand Down

0 comments on commit fa1e493

Please sign in to comment.