From 94c56ea09c046ddfa0838644f64f344281698360 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sat, 27 Oct 2018 17:55:55 +0000 Subject: [PATCH] native: enable backtrace on some BSDs --- CMakeLists.txt | 2 ++ ext/native/base/backtrace.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfe966b5ae..5193b756a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1073,6 +1073,8 @@ if(ANDROID) target_link_libraries(native log EGL OpenSLES) elseif(WIN32) target_link_libraries(native ws2_32 winmm) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "^(DragonFly|FreeBSD|NetBSD)$") + target_link_libraries(native execinfo) endif() setup_target_project(native native) diff --git a/ext/native/base/backtrace.cpp b/ext/native/base/backtrace.cpp index 6c22f209ff..2b5cddb972 100644 --- a/ext/native/base/backtrace.cpp +++ b/ext/native/base/backtrace.cpp @@ -1,6 +1,6 @@ #include "base/backtrace.h" -#if defined(__GLIBC__) && !defined(__UCLIBC__) +#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) #include #include