From 03efa4e72372eba4dd19b557ccfa775c9f7c4a30 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Tue, 16 Jul 2024 22:13:14 -0400 Subject: [PATCH] added sanitizer, release and debug optimizations and move debug symbols to general flags due to being useful with sanitizer --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09e61f0..b312fb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,13 @@ project(project_name_here set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # allowances for debugging -set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_DEBUG "-Og") + +# release optimizations +set(CMAKE_CXX_FLAGS_DEBUG "-O2") # generally useful -set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wfloat-equal -Wundef -Wpointer-arith -Wcast-align -Wstrict-overflow=2 -Wunreachable-code") +set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wfloat-equal -Wundef -Wpointer-arith -Wcast-align -Wstrict-overflow=2 -Wunreachable-code -fsanitize=address,undefined -g3") # for convenience if they're needed #find_package(Boost REQUIRED) #find_package(fmt REQUIRED)