EternalTerminal: Remove manual compile flag

Re-edited CMakeLists.txt and sources to compile
with or without libexecinfo if system supports it

Signed-off-by: Nathan Owens <ndowens04@gmail.com>
This commit is contained in:
Nathan Owens 2019-12-27 19:11:01 -06:00 committed by Juan RP
parent 18c9df0722
commit 29ca1a9248
2 changed files with 19 additions and 27 deletions

View file

@ -1,22 +1,22 @@
diff --git CMakeLists.txt CMakeLists.txt
index b277dff..9ee989c 100644
index b277dff..ad24b56 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -12,6 +12,12 @@ endif()
@@ -125,6 +125,12 @@ include_directories(
${UTEMPTER_INCLUDE_DIR}
)
option(CODE_COVERAGE "Enable code coverage" OFF)
option(DISABLE_CRASH_LOG "Disable installing easylogging crash handler" OFF)
+option(ENABLE_EXECINFO "Enable execinfo support" OFF)
+
+if(ENABLE_EXECINFO)
+ SET(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -lexecinfo")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_EXECINFO")
+include(CheckIncludeFileCXX)
+check_include_file("execinfo.h" HAVE_EXECINFO_H)
+if (HAVE_EXECINFO_H)
+ add_definitions(-DHAVE_EXECINFO_H)
+endif()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DET_VERSION='\"${PROJECT_VERSION}\"'")
# For easylogging, disable default log file, enable crash log, ensure thread safe, and catch c++ exceptions
+
add_library(
et-lib
STATIC
diff --git external_imported/easyloggingpp/src/easylogging++.cc external_imported/easyloggingpp/src/easylogging++.cc
index d763ee7..1237d9c 100644
index d763ee7..02e8b75 100644
--- external_imported/easyloggingpp/src/easylogging++.cc
+++ external_imported/easyloggingpp/src/easylogging++.cc
@@ -2786,7 +2786,7 @@ std::ostream& operator<<(std::ostream& os, const StackTrace& st) {
@ -24,24 +24,20 @@ index d763ee7..1237d9c 100644
void StackTrace::generateNew(void) {
-#if ELPP_STACKTRACE
+#ifdef ENABLE_EXECINFO
+#ifdef HAVE_EXECINFO_H
m_stack.clear();
void* stack[kMaxStack];
unsigned int size = backtrace(stack, kMaxStack);
diff --git external_imported/easyloggingpp/src/easylogging++.h external_imported/easyloggingpp/src/easylogging++.h
index 688d537..b4d754e 100644
index 688d537..0b16966 100644
--- external_imported/easyloggingpp/src/easylogging++.h
+++ external_imported/easyloggingpp/src/easylogging++.h
@@ -360,10 +360,10 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre
@@ -360,7 +360,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre
# include <codecvt>
# endif // ELPP_OS_WINDOWS
#endif // defined(ELPP_UNICODE)
-#if ELPP_STACKTRACE
+#ifdef ENABLE_EXECINFO
+#ifdef HAVE_EXECINFO_H
# include <cxxabi.h>
# include <execinfo.h>
-#endif // ELPP_STACKTRACE
+#endif // ENABLE_EXECINFO
#if ELPP_OS_ANDROID
# include <sys/system_properties.h>
#endif // ELPP_OS_ANDROID
#endif // ELPP_STACKTRACE

View file

@ -1,7 +1,7 @@
# Template file for 'EternalTerminal'
pkgname=EternalTerminal
version=6.0.5
revision=1
revision=2
wrksrc="${pkgname}-et-v${version}"
build_style=cmake
hostmakedepends="protobuf"
@ -16,10 +16,6 @@ system_accounts="_eternal"
LDFLAGS="-lgflags"
case "$XBPS_TARGET_LIBC" in
glibc) configure_args="-DENABLE_EXECINFO=ON";;
esac
post_install() {
vsv etserver
}