diff --git a/ext/libclementine-common/CMakeLists.txt b/ext/libclementine-common/CMakeLists.txt index dda4dd5f7..ad35a515c 100644 --- a/ext/libclementine-common/CMakeLists.txt +++ b/ext/libclementine-common/CMakeLists.txt @@ -39,3 +39,6 @@ target_link_libraries(libclementine-common ${TAGLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ) + +find_package(Backtrace) +configure_file(core/conf_backtrace.h.in conf_backtrace.h) diff --git a/ext/libclementine-common/core/conf_backtrace.h.in b/ext/libclementine-common/core/conf_backtrace.h.in new file mode 100644 index 000000000..af5eb1934 --- /dev/null +++ b/ext/libclementine-common/core/conf_backtrace.h.in @@ -0,0 +1,4 @@ +#cmakedefine Backtrace_FOUND +#ifdef Backtrace_FOUND +#include <@Backtrace_HEADER@> +#endif diff --git a/ext/libclementine-common/core/logging.cpp b/ext/libclementine-common/core/logging.cpp index 737208493..fbe26932b 100644 --- a/ext/libclementine-common/core/logging.cpp +++ b/ext/libclementine-common/core/logging.cpp @@ -21,9 +21,7 @@ #include #include -#ifdef Q_OS_UNIX -#include -#endif +#include "conf_backtrace.h" #include @@ -325,7 +323,7 @@ QString DemangleSymbol(const QString& symbol) { } void DumpStackTrace() { -#ifdef Q_OS_UNIX +#ifdef Backtrace_FOUND void* callstack[128]; int callstack_size = backtrace(reinterpret_cast(&callstack), sizeof(callstack));