diff --git CMakeLists.txt CMakeLists.txt index b277dff..ad24b56 100644 --- CMakeLists.txt +++ CMakeLists.txt @@ -125,6 +125,12 @@ include_directories( ${UTEMPTER_INCLUDE_DIR} ) +include(CheckIncludeFileCXX) +check_include_file("execinfo.h" HAVE_EXECINFO_H) +if (HAVE_EXECINFO_H) + add_definitions(-DHAVE_EXECINFO_H) +endif() + add_library( et-lib STATIC diff --git external_imported/easyloggingpp/src/easylogging++.cc external_imported/easyloggingpp/src/easylogging++.cc 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) { } void StackTrace::generateNew(void) { -#if ELPP_STACKTRACE +#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..0b16966 100644 --- external_imported/easyloggingpp/src/easylogging++.h +++ external_imported/easyloggingpp/src/easylogging++.h @@ -360,7 +360,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre # include # endif // ELPP_OS_WINDOWS #endif // defined(ELPP_UNICODE) -#if ELPP_STACKTRACE +#ifdef HAVE_EXECINFO_H # include # include #endif // ELPP_STACKTRACE