Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: allow to disable symbolize #620

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -416,7 +416,7 @@ if (WITH_SYMBOLIZE)
}
]=] HAVE_SYMBOLIZE)

cmake_pop_check_state ()
cmake_pop_check_state ()

if (HAVE_SYMBOLIZE)
set (HAVE_STACKTRACE 1)
@@ -426,6 +426,11 @@ if (WITH_SYMBOLIZE)
endif (WIN32 OR CYGWIN)
endif (WITH_SYMBOLIZE)

# CMake manages symbolize availability. The definition is necessary only when
# building the library. Switch to add_compile_definitions once we drop support
# for CMake below version 3.12.
add_definitions (-DGLOG_NO_SYMBOLIZE_DETECTION)

check_cxx_source_compiles ("
#include <cstdlib>
#include <time.h>
2 changes: 2 additions & 0 deletions src/utilities.h
Original file line number Diff line number Diff line change
@@ -127,6 +127,7 @@
# define HAVE_STACKTRACE
#endif

#ifndef GLOG_NO_SYMBOLIZE_DETECTION
#ifndef HAVE_SYMBOLIZE
// defined by gcc
#if defined(__ELF__) && defined(OS_LINUX)
@@ -139,6 +140,7 @@
# define HAVE_SYMBOLIZE
#endif
#endif // !defined(HAVE_SYMBOLIZE)
#endif // !defined(GLOG_NO_SYMBOLIZE_DETECTION)

#ifndef ARRAYSIZE
// There is a better way, but this is good enough for our purpose.