Compile with -D_GNU_SOURCE

Needed by `boost::stacktrace` for `_Unwind_Backtrace()`.
This commit is contained in:
Julian Brost 2020-10-28 10:26:39 +01:00
parent cdfcef4d63
commit 3ad9d3316c

View File

@ -364,9 +364,13 @@ if(HAVE_LIBEXECINFO)
list(APPEND base_DEPS execinfo)
endif()
if(NOT WIN32)
# boost::stacktrace uses _Unwind_Backtrace which is only exposed if _GNU_SOURCE is defined on most systems
add_definitions(-D_GNU_SOURCE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(ICINGA2_STACKTRACE_USE_BACKTRACE_SYMBOLS TRUE)
add_definitions(-D_GNU_SOURCE)
endif()
if(ICINGA2_STACKTRACE_USE_BACKTRACE_SYMBOLS AND NOT HAVE_BACKTRACE_SYMBOLS)