File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
cmake/build_configurations Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,21 @@ IF(UNIX)
174174 STRING_PREPEND(CMAKE_CXX_FLAGS_RELEASE "${SECTIONS_FLAG} " )
175175 STRING_PREPEND(CMAKE_CXX_FLAGS_MINSIZEREL "${SECTIONS_FLAG} " )
176176
177+ # We need -O3 by default for RelWithDebInfo in order to avoid
178+ # performance regressions from earlier releases.
179+ # To disable this (and everything else in this file),
180+ # do 'cmake -DWITH_DEFAULT_COMPILER_OPTIONS=NO'.
181+ IF (LINUX)
182+ FOREACH (flag
183+ CMAKE_C_FLAGS_RELEASE
184+ CMAKE_C_FLAGS_RELWITHDEBINFO
185+ CMAKE_CXX_FLAGS_RELEASE
186+ CMAKE_CXX_FLAGS_RELWITHDEBINFO
187+ )
188+ STRING (REPLACE "-O2" "-O3" "${flag} " "${${flag} }" )
189+ ENDFOREACH ()
190+ ENDIF ()
191+
177192ENDIF ()
178193
179194SET (CMAKE_C_FLAGS_DEBUG
You can’t perform that action at this time.
0 commit comments