From 3a0e37ee8acd2b05f1e5c2d1ec5632440f6d9ac7 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Thu, 21 Nov 2024 02:08:21 -0600 Subject: [PATCH] update configure script --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86ee8509..427564e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,17 @@ project(Darkflame ) # TEMP - Sanitizer flags +if (UNIX) # add_compile_options("-fsanitize=address,undefined" "-fvisibility=default") -add_compile_options("-fsanitize=undefined" "-fvisibility=default") -add_link_options("-fsanitize=undefined" "-static-libasan") + add_compile_options("-fsanitize=undefined" "-fvisibility=default") + add_link_options("-fsanitize=undefined") + + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_link_options("-static-libsan") + else() + add_link_options("-static-libasan") + endif() +endif() # check if the path to the source directory contains a space if("${CMAKE_SOURCE_DIR}" MATCHES " ")