Skip to content

Commit

Permalink
Remove CMake custom compiler flags for RELEASE and DEBUG build
Browse files Browse the repository at this point in the history
This overwrites the default that cmake automatically sets. In the
case of debug builds, this breaks debugging as -O1 already optimises
many variables away.

Change-Id: I3ca6965799b23d542ababc3e38880317cb46a3ac
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/search?l=mid&[email protected]
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed Nov 9, 2023
1 parent a0afe03 commit 753cba2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ if (MSVC)
add_link_options("$<$<CONFIG:Release>:/CETCOMPAT>")
endif()
else ()
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-g -O1")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O1")
add_compile_options(-Wall -Wuninitialized)
check_c_compiler_flag(-Wno-stringop-truncation NoStringOpTruncation)

Expand Down

0 comments on commit 753cba2

Please sign in to comment.