diff options
| -rw-r--r-- | CMakeLists.txt | 9 |
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() |
