1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
if(WIN32)
if(MINGW)
find_package(BFD REQUIRED)
find_package(Iberty REQUIRED)
# Non-MSYS2-MinGW builds seem not to require Intl but only ZLIB
if(MSYS)
find_package(Intl REQUIRED)
else()
find_package(Intl QUIET)
endif()
find_package(ZLIB REQUIRED)
# zstd is required since binutils 2.40
find_package(zstd REQUIRED)
# SFrame is required and exists only since binutils 2.40
find_package(SFrame QUIET)
endif()
endif()
add_library(stack_trace_stack OBJECT)
add_library(stack_trace::stack ALIAS stack_trace_stack)
target_sources(stack_trace_stack
PRIVATE
stack_trace/stack.cpp
stack_trace/stack.hpp
)
target_include_directories(stack_trace_stack
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
)
if(WIN32)
if(MINGW)
target_link_libraries(stack_trace_stack
PRIVATE
BFD::BFD
Iberty::Iberty
$<TARGET_NAME_IF_EXISTS:Intl::Intl>
ZLIB::ZLIB
zstd::libzstd_shared
$<TARGET_NAME_IF_EXISTS:SFrame::SFrame>
psapi # TODO: Only required for systems older than Windows 7
)
endif()
target_link_libraries(stack_trace_stack
PRIVATE
imagehlp
)
else()
target_link_libraries(stack_trace_stack
PRIVATE
dl
)
endif()
|