Remove a '-O2' unconditionally added to ${CMAKE_CXX_FLAGS}: we

already pass '-O2' to the build.

That '-Wall -Wsign-compare -O2 -O2 -pipe' was hurting my sense of
aesthetics.
This commit is contained in:
dcoppa 2016-08-19 19:42:04 +00:00
parent c153668976
commit a5accf8c1d

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-CMakeLists_txt,v 1.1 2016/08/19 19:42:04 dcoppa Exp $
--- CMakeLists.txt.orig Fri Aug 19 11:42:02 2016
+++ CMakeLists.txt Fri Aug 19 11:42:58 2016
@@ -236,14 +236,6 @@ else()
set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}")
# Also see CMP0043...
- # Optimizations are enabled unconditionally because they make a big difference in the speed of the
- # resulting binaries, and that it is better to allow an opt-out from them by adjusting CXXFLAGS through
- # an env var at cmake time if needed.
- # The reason for not manipulating just CMAKE_CXX_FLAGS_DEBUG is that unrecognized build types ("DebugFull")
- # should still benefit from these optimizations. Yup, it would be even better if CMake did a sane thing
- # and warned when users set an unrecognized and unused build type, but that just isn't the case.
- set(CMAKE_CXX_FLAGS "-O2 ${CMAKE_CXX_FLAGS}")
-
# Build warnings are useful tools (and Trojita should be warning-free anyway), enable them on all
# configurations. They are warnings, not errors.
set(CMAKE_CXX_FLAGS "-Wall -Wsign-compare ${CMAKE_CXX_FLAGS}")