Use StackWalk64 for mingw and cleanup checks performed in cmake
This commit is contained in:
parent
d84a3167d9
commit
556d7fe33d
@ -93,17 +93,16 @@ function(check_support var source includes libraries definitions)
|
||||
set(${var} ${${var}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(MINGW OR NOT WIN32) # No need to bother checking in msvc, but do check in minngw
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
check_support(HAS_CXXABI has_cxxabi.cpp "" "" "")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32) # No need to bother checking in msvc, but do check in minngw
|
||||
check_support(HAS_UNWIND has_unwind.cpp "" "" "")
|
||||
check_support(HAS_EXECINFO has_execinfo.cpp "" "" "")
|
||||
check_support(HAS_BACKTRACE has_backtrace.cpp "" "backtrace" "${CPPTRACE_BACKTRACE_PATH_DEFINITION}")
|
||||
check_support(HAS_DL has_dl.cpp "" "dl" "")
|
||||
check_support(HAS_CXXABI has_cxxabi.cpp "" "" "")
|
||||
if(NOT MSVC)
|
||||
set(STACKTRACE_LINK_LIB "stdc++_libbacktrace")
|
||||
else()
|
||||
set(STACKTRACE_LINK_LIB "")
|
||||
endif()
|
||||
check_support(HAS_STACKTRACE has_stacktrace.cpp "" "${STACKTRACE_LINK_LIB}" "")
|
||||
if(APPLE)
|
||||
find_program(ADDR2LINE_PATH atos PATHS ENV PATH)
|
||||
@ -141,19 +140,11 @@ if(
|
||||
message(FATAL_ERROR "Cpptrace auto config: No unwinding back-end seems to be supported, stack tracing will not work. To compile anyway set CPPTRACE_UNWIND_WITH_NOTHING.")
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
if(HAS_UNWIND)
|
||||
set(CPPTRACE_UNWIND_WITH_UNWIND On)
|
||||
message(STATUS "Cpptrace auto config: Using libgcc unwind for unwinding")
|
||||
elseif(HAS_EXECINFO)
|
||||
set(CPPTRACE_UNWIND_WITH_EXECINFO On)
|
||||
message(STATUS "Cpptrace auto config: Using execinfo.h for unwinding")
|
||||
else()
|
||||
set(CPPTRACE_UNWIND_WITH_WINAPI On)
|
||||
message(STATUS "Cpptrace auto config: Using winapi for unwinding")
|
||||
endif()
|
||||
set(CPPTRACE_UNWIND_WITH_DBGHELP On)
|
||||
message(STATUS "Cpptrace auto config: Using dbghelp for unwinding")
|
||||
elseif(WIN32)
|
||||
set(CPPTRACE_UNWIND_WITH_DBGHELP On)
|
||||
message(STATUS "Cpptrace auto config: Using winapi for unwinding")
|
||||
message(STATUS "Cpptrace auto config: Using dbghelp for unwinding")
|
||||
endif()
|
||||
else()
|
||||
#message(STATUS "MANUAL CONFIG SPECIFIED")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user