cmake: more reliable backtrace strategy discovery

This commit is contained in:
Danny Robson 2017-02-01 13:46:33 +11:00
parent 256e1c32b3
commit c57569a4ff
2 changed files with 10 additions and 17 deletions

View File

@ -38,16 +38,21 @@ set (UTIL_FILES)
###############################################################################
search_libs (BACKTRACE_LIB backtrace execinfo)
check_function_exists (RtlCaptureStackBackTrace HAVE_CAPTURESTACKBACKTRACE)
search_libs (DBGHELP_LIB SymFromAddr dbghelp)
check_function_exists(RtlCaptureStackBackTrace HAVE_STACKWALK)
check_function_exists (RtlCaptureStackBackTrace HAVE_CAPTURESTACKBACKTRACE)
##-----------------------------------------------------------------------------
if (BACKTRACE_LIB)
list (APPEND backtrace_files execinfo)
if (BACKTRACE_LIB_FOUND)
list (APPEND UTIL_FILES backtrace_execinfo.cpp)
elseif (HAVE_CAPTURESTACKBACKTRACE)
list (APPEND UTIL_FILES backtrace_stackwalk.cpp)
else ()
list (APPEND UTIL_FILES backtrace_null.cpp)
endif ()
##-----------------------------------------------------------------------------
if (NOT WIN32)
find_program(ADDR2LINE NAMES addr2line)
if (ADDR2LINE)
@ -56,18 +61,6 @@ if (NOT WIN32)
endif ()
##-----------------------------------------------------------------------------
if (HAVE_CAPTURESTACKBACTRACE)
list (APPEND backtrace_files stackwalk win32)
endif ()
##-----------------------------------------------------------------------------
list (APPEND backtrace_files null)
list (GET backtrace_files 0 backtrace_scheme)
list (APPEND UTIL_FILES backtrace_${backtrace_scheme}.cpp)
###############################################################################
# Platform wrappers
if (LINUX)

2
cmake

@ -1 +1 @@
Subproject commit d106a052a1aa844bc074f6025df4a454d6daf9be
Subproject commit 45be843568fb894d7ca2e33a485be0b6998acf92