Skip to content

Commit b8fe333

Browse files
committed
cmake: Fixed O3 replacement
1 parent 4af241b commit b8fe333

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ else()
185185
string(REGEX REPLACE "-DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
186186
string(REGEX REPLACE "-DNDEBUG[ \t\r\n]*" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
187187
# Prefer -O2 optimization level. (-O3 is CMake's default for Release for many compilers.)
188-
string(REGEX REPLACE "-O3[ \t\r\n]*" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
188+
string(REGEX REPLACE "-O3( |$)" "-O2\\1" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
189189
endif()
190190

191191
# Define custom "Coverage" build type.

0 commit comments

Comments
 (0)