CMake: Fix full rebuilds when using MSVC and reconfiguring the build
When reconfiguring an MSVC -release build with 'cmake .' after a full
build, instead of being a no-op, it rebuilt everything.
This happened because of CMAKE_CXX_FLAGS_RELEASE being accidentally
modified on each reconfiguration, resulting in extra whitespace being
added to the compiler command line rules.
Specifically, this was because we always added '-O2 -Ob3 ' as a string
to the compiler flags, but due to stripping, always tried to remove
only '-O2 -Ob3' (no trailing white space) when removing the
optimizations flags, resulting in an extra white space for each run.
Remove the trailing white space after '-Ob3 '.
Amends 2fb134f3fe
Change-Id: I46eb4c3b769ae6b063fe62df05c0cb92f13bda30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fdb9a5141446ed8aa767d88a921c24221b0704ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 38835684b3b83b9d9795dd37435fbb5a29050e57)
bb10
parent
cd04bfe905
commit
08a6fae9f9
|
|
@ -101,7 +101,7 @@ if(MSVC)
|
||||||
if(NOT CLANG)
|
if(NOT CLANG)
|
||||||
# -Ob3 was introduced in Visual Studio 2019 version 16.0
|
# -Ob3 was introduced in Visual Studio 2019 version 16.0
|
||||||
# However clang-cl can't recognize it.
|
# However clang-cl can't recognize it.
|
||||||
string(APPEND QT_CFLAGS_OPTIMIZE " -Ob3 ")
|
string(APPEND QT_CFLAGS_OPTIMIZE " -Ob3")
|
||||||
endif()
|
endif()
|
||||||
set(QT_CFLAGS_OPTIMIZE_DEBUG "-Od")
|
set(QT_CFLAGS_OPTIMIZE_DEBUG "-Od")
|
||||||
set(QT_CFLAGS_OPTIMIZE_SIZE "-O1")
|
set(QT_CFLAGS_OPTIMIZE_SIZE "-O1")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue