From b0e33053f972c94d71acd5729f4743148586f2eb Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sun, 16 Oct 2022 21:15:44 +0200 Subject: [PATCH] Use debug flags for sanitizer builds --- cmake/cxx.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/cxx.cmake b/cmake/cxx.cmake index 9e4aa08f..f9b3db45 100644 --- a/cmake/cxx.cmake +++ b/cmake/cxx.cmake @@ -25,10 +25,10 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) set(POLYBAR_FLAGS "" CACHE STRING "C++ compiler flags used for compiling polybar") list(APPEND cxx_base -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor) -list(APPEND cxx_debug -DDEBUG -g2) +list(APPEND cxx_debug -DDEBUG -g2 -Og) list(APPEND cxx_minsizerel "") -list(APPEND cxx_sanitize -O0 -g -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls) -list(APPEND cxx_coverage --coverage) +list(APPEND cxx_sanitize ${cxx_debug} -O0 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls) +list(APPEND cxx_coverage ${cxx_debug} --coverage) list(APPEND cxx_linker_base "") list(APPEND cxx_linker_minsizerel "") @@ -79,8 +79,6 @@ elseif(CXXLIB_GCC) list(APPEND cxx_linker_base -lstdc++) endif() -# Custom build type 'Coverage', inherits the debug flags -list(APPEND cxx_coverage ${cxx_debug} ${cxx_coverage}) SET(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COVERAGE}") SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${CMAKE_EXE_LINKER_FLAGS_COVERAGE}") SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${CMAKE_SHARED_LINKER_FLAGS_COVERAGE}")