diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 67ced5a0..c7ac9ced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ else() endif() include(CheckCCompilerFlag) +include(CheckCSourceCompiles) include(CheckFunctionExists) include(CheckIncludeFile) include(CheckSymbolExists) @@ -339,6 +340,17 @@ if (NOT HAVE_SIGSETJMP) add_definitions("-DGC_NO_SIGSETJMP") endif() +# Check for dladdr (used for debugging). +check_c_source_compiles(" +#define _GNU_SOURCE 1\n +#include <dlfcn.h>\n +int main(void) { Dl_info info; (void)dladdr(\"\", &info); return 0; }" + HAVE_DLADDR) +if (HAVE_DLADDR) + # Define to use 'dladdr' function. + add_definitions("-DHAVE_DLADDR") +endif() + add_library(gc ${SRC}) if (enable_threads) target_link_libraries(gc PRIVATE ${THREADDLLIBS}) |