diff options
| author | onelin <oscar@nelin.dk> | 2025-03-15 19:15:20 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2025-03-15 19:19:20 +0000 |
| commit | ed3fcf9546eb8a6a3b89b20dcf1ff5d9bc5f3e55 (patch) | |
| tree | 3cdbdec6f75e1017f4f8e53af3d0f52866760c1c | |
| parent | 739ed32d266aaee217797f6a209efa7f05568c64 (diff) | |
Add common compile flags
| -rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bf9871..06e20d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,11 +60,27 @@ 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 + -m64 # Target 64-bit architechture + -Wall -Wextra # All the good default warnings + -Wfloat-equal + -Wundef + -Wshadow + -Wpointer-arith + -Wcast-align + -Wstrict-prototypes + -Wwrite-strings + -Wswitch-default + -Wconversion +) + +# These are not actually used (TODO) if(DAW_BUILD_DEBUG) - set(BUILD_OPTS -m64 -Og -ggdb3 -fno-omit-frame-pointer) + set(BUILD_OPTS ${DEFAULT_ARGS} -Og -ggdb3 -fno-omit-frame-pointer) else() - set(BUILD_OPTS -m64 -O2 -flto=auto -fuse-linker-plugin -ffat-lto-objects - -funroll-loops -ffast-math -fno-signed-zeros -fno-trapping-math + set(BUILD_OPTS ${DEFAULT_ARGS} -O2 -flto=auto -fuse-linker-plugin -ffat-lto-objects + -funroll-loops -fno-signed-zeros -fno-trapping-math -ffunction-sections -fdata-sections) endif() |
