summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOBATA Akio <[email protected]>2020-08-16 18:15:33 +0900
committerOBATA Akio <[email protected]>2020-08-17 11:24:30 +0900
commit2167207adc49b498536a5a8533c27fc67e0c6e9c (patch)
treed00433343d58c044a2231df6c55fde1813e8058f /CMakeLists.txt
parent24045f55ce52cd0622a0b78e6cd36b99e11f39ac (diff)
downloadtdelibs-2167207adc49b498536a5a8533c27fc67e0c6e9c.tar.gz
tdelibs-2167207adc49b498536a5a8533c27fc67e0c6e9c.zip
Allow to use backtrace(3) external library for kdebug
Signed-off-by: OBATA Akio <[email protected]>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98d4ddb94..4cd20e81b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -334,7 +334,18 @@ check_symbol_exists( gethostbyname2_r "netdb.h" HAVE_GETHOSTBYNAME2_R )
check_symbol_exists( gethostbyname_r "netdb.h" HAVE_GETHOSTBYNAME_R )
check_symbol_exists( gai_strerror "sys/types.h;sys/socket.h;netdb.h" HAVE_GAI_STRERROR )
check_symbol_exists( getaddrinfo "sys/types.h;sys/socket.h;netdb.h" HAVE_GETADDRINFO )
-check_symbol_exists( backtrace "execinfo.h" HAVE_BACKTRACE )
+if ( CMAKE_MAJOR_VERSION LESS "3" )
+ check_symbol_exists( backtrace "execinfo.h" HAVE_BACKTRACE )
+ if ( HAVE_BACKTRACE )
+ set ( Backtrace_LIBRARY "" )
+ set ( Backtrace_HEADER "execinfo.h" )
+ endif ()
+else ()
+ find_package( Backtrace )
+ if ( Backtrace_FOUND )
+ set ( HAVE_BACKTRACE 1 )
+ endif ()
+endif ()
check_cxx_source_compiles( "#include <cxxabi.h>
int main() { abi::__cxa_demangle(0, 0, 0, 0); return 0; }"
HAVE_ABI_CXA_DEMANGLE )