[Openvpn-devel,v1] Remove CMake custom compiler flags for RELEASE and DEBUG build

Message ID 20231107141755.30559-1-frank@lichtenheld.com
State Accepted
Headers show
Series [Openvpn-devel,v1] Remove CMake custom compiler flags for RELEASE and DEBUG build | expand

Commit Message

Frank Lichtenheld Nov. 7, 2023, 2:17 p.m. UTC
From: Arne Schwabe <arne@rfc2549.org>

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 <frank@lichtenheld.com>
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/374
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>

Comments

Gert Doering Nov. 9, 2023, 11:36 a.m. UTC | #1
Your patch has been applied to the master branch.

commit 753cba211c4752ef13d810b757f1aa7dee89626b
Author: Arne Schwabe
Date:   Tue Nov 7 15:17:55 2023 +0100

     Remove CMake custom compiler flags for RELEASE and DEBUG build

     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Message-Id: <20231107141755.30559-1-frank@lichtenheld.com>
     URL: https://www.mail-archive.com/search?l=mid&q=20231107141755.30559-1-frank@lichtenheld.com
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 376a060..d21c9bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,10 +79,6 @@ 
         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)