mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-19 17:25:17 +03:00
38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
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)
|
|
|