summaryrefslogtreecommitdiffstats
path: root/kmtrace/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-09-15 22:18:04 +0200
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-09-23 17:11:30 +0900
commit443e9d7cf59bb88f8920628405b2e1c6aaf770d0 (patch)
treeae5ebcd9f4142c171550884de6157877bb3a43ae /kmtrace/ConfigureChecks.cmake
parent08cea68d1ac6b82ce7fb7aa3c152c272afb5a135 (diff)
downloadtdesdk-443e9d7c.tar.gz
tdesdk-443e9d7c.zip
Add a backtrace function and library detection.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit cf63191672fff12cd57892ba4642ed4f01e9c6a4)
Diffstat (limited to 'kmtrace/ConfigureChecks.cmake')
-rw-r--r--kmtrace/ConfigureChecks.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/kmtrace/ConfigureChecks.cmake b/kmtrace/ConfigureChecks.cmake
new file mode 100644
index 00000000..5c06aac6
--- /dev/null
+++ b/kmtrace/ConfigureChecks.cmake
@@ -0,0 +1,18 @@
+
+##### check if GLIBC >= 2.1 compatible backtrace facility exists
+
+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 CACHE INTERNAL "" )
+ endif ()
+endif ()
+if( NOT HAVE_BACKTRACE )
+ tde_message_fatal( "bactrace function is required but not available on your system")
+endif()