From 3b33a9561a9d8cc7cbdb7f1bcb208c21e9cbb496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20B=C3=B6ger?= Date: Mon, 31 May 2021 09:03:55 +0100 Subject: [PATCH] add SEXP_USE_BOEHM configuration option --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 286e0f64..c7bc8e8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ else() endif() option(BUILD_SHARED_LIBS "Build chibi-scheme as a shared library" ${DEFAULT_SHARED_LIBS}) +option(SEXP_USE_BOEHM "Use Boehm garbage collection library" OFF) set(chibi-scheme-exclude-modules) if(WIN32) @@ -101,6 +102,18 @@ if(CYGWIN) target_compile_definitions(libchibi-common INTERFACE SEXP_USE_STRING_STREAMS=0) endif() +if(SEXP_USE_BOEHM) + find_library(BOEHMGC gc REQUIRED) + find_path(BOEHMGC_INCLUDE NAMES gc/gc.h) + target_compile_definitions(libchibi-common INTERFACE SEXP_USE_BOEHM=1) + target_include_directories(libchibi-common INTERFACE ${BOEHMGC_INCLUDE}) + target_link_libraries(libchibi-common INTERFACE ${BOEHMGC} + $<$:-fsanitize=address,undefined>) +else() + target_link_libraries(libchibi-common INTERFACE + $<$:-fsanitize=address,undefined>) +endif() + target_compile_options(libchibi-common INTERFACE $<$:-g