added sanitizer, release and debug optimizations and move debug symbols to general flags due to being useful with sanitizer

This commit is contained in:
Pagwin 2024-07-16 22:13:14 -04:00
parent f20bed8a52
commit 03efa4e723
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -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)