aboutsummaryrefslogtreecommitdiffstats
path: root/testing/easyloggingpp-dev/musl-compat.patch
blob: ca5efebc87278f5db9ebfc1c29aede3006e1834e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From b691bec24cf7a3d35748e47da78e3f98d6b9817d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= <aklitzing@gmail.com>
Date: Wed, 21 Jun 2017 20:21:01 +0200
Subject: [PATCH] Add __has_include check for execinfo.h

This header is necessary later for the stacktrace feature.
This fixes musl based distributions.

--- a/src/easylogging++.h
+++ b/src/easylogging++.h
@@ -205,7 +205,7 @@
 #  define ELPP_INTERNAL_INFO(lvl, msg)
 #endif  // (defined(ELPP_DEBUG_INFO))
 #if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG))
-#  if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN)
+#  if (__has_include(<execinfo.h>) && ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN)
 #    define ELPP_STACKTRACE 1
 #  else
 #      if ELPP_COMPILER_MSVC
--- a/cmake/easyloggingpp.pc.cmakein.orig
+++ b/cmake/easyloggingpp.pc.cmakein
@@ -3,4 +3,6 @@
 Version: @ELPP_VERSION_STRING@
 prefix=@CMAKE_INSTALL_PREFIX@
 includedir=@ELPP_INCLUDE_INSTALL_DIR@
+libdir=@CMAKE_INSTALL_PREFIX@/lib
+Libs: -L${libdir} -lexecinfo
 Cflags: -I${includedir}
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,6 +92,7 @@
         ELPP_FRESH_LOG_FILE
     )
 
+    target_link_libraries(easyloggingpp-unit-tests execinfo)
     # Standard linking to gtest stuff.
     target_link_libraries(easyloggingpp-unit-tests gtest gtest_main)