From 3e1ae910ed1e36f90c5d9a120ff56344e5072bad Mon Sep 17 00:00:00 2001 From: onelin Date: Fri, 21 Mar 2025 10:39:20 +0100 Subject: Actually use asan --- CMakeLists.txt | 9 +++++---- 1 file 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 + "$<$:-fsanitize=address;>" + "$<$:-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() -- cgit v1.3