summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2025-03-21 09:39:20 +0000
committeronelin <oscar@nelin.dk>2025-03-21 10:26:26 +0000
commit3e1ae910ed1e36f90c5d9a120ff56344e5072bad (patch)
tree6f47b5ac6630a4886fd68374a73846f8a6d7be7c /CMakeLists.txt
parenta44692ef4c0ac49f4b6330a1f53a7f26fb38b864 (diff)
Actually use asan
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f4bd69..fb9659d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,8 +60,7 @@ if(DAW_BUILD_UBSAN AND DAW_BUILD_ASAN)
message(FATAL_ERROR "You cannot build both asan and ubsan")
endif()
-# These are not actually used (TODO)
-set(DEFAULT_ARGS
+set(DAW_COMPILE_FLAGS
-m64 # Target 64-bit architechture
-Wall -Wextra # All the good default warnings
-Wundef
@@ -71,13 +70,15 @@ set(DEFAULT_ARGS
-Wstrict-prototypes
-Wwrite-strings
-Wconversion
+ "$<$<BOOL:${DAW_BUILD_ASAN}>:-fsanitize=address;>"
+ "$<$<BOOL:${DAW_BUILD_UBSAN}>:-fsanitize=undefined;>"
)
# These are not actually used (TODO)
if(DAW_BUILD_DEBUG)
- set(BUILD_OPTS ${DEFAULT_ARGS} -Og -ggdb3 -fno-omit-frame-pointer)
+ set(BUILD_OPTS ${DAW_COMPILE_FLAGS} -Og -ggdb3 -fno-omit-frame-pointer)
else()
- set(BUILD_OPTS ${DEFAULT_ARGS} -O2 -flto=auto -fuse-linker-plugin -ffat-lto-objects
+ set(BUILD_OPTS ${DAW_COMPILE_FLAGS} -O2 -flto=auto -fuse-linker-plugin -ffat-lto-objects
-funroll-loops -fno-signed-zeros -fno-trapping-math
-ffunction-sections -fdata-sections)
endif()