diff --git a/cmake/KLLVMCompilerFlags.cmake b/cmake/KLLVMCompilerFlags.cmake index 270711c6d..e86544183 100644 --- a/cmake/KLLVMCompilerFlags.cmake +++ b/cmake/KLLVMCompilerFlags.cmake @@ -41,3 +41,10 @@ include_directories(${PROJECT_SOURCE_DIR}/include) # Auto-generated header path set(KLLVM_AUTOGEN_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include) include_directories(${KLLVM_AUTOGEN_INCLUDE_DIR}) + +option(K_LLVM_STACK_MAPS "Enable stack-map-based GC for the LLVM backend" OFF) +if (K_LLVM_STACK_MAPS) + set(K_LLVM_STACK_MAPS_FLAG "1") +else() + set(K_LLVM_STACK_MAPS_FLAG "0") +endif() diff --git a/config/macros.h b/config/macros.h index d3c248533..7837f48b4 100644 --- a/config/macros.h +++ b/config/macros.h @@ -39,4 +39,6 @@ #define BACKEND_TARGET_DATALAYOUT TOSTRING(@BACKEND_TARGET_DATALAYOUT@) #define BACKEND_TARGET_TRIPLE TOSTRING(@BACKEND_TARGET_TRIPLE@) +#define K_LLVM_STACK_MAPS @K_LLVM_STACK_MAPS_FLAG@ + #endif