qtbase: fix clang-cl warning

clang-cl can't recognize the "-Ob3" parameter and it causes tons
warnings when compiling, just remove it if we are using clang-cl.

Change-Id: If50dccef15f771fc956eed218e97645d78d59073
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Yuhang Zhao 2023-10-07 13:54:51 +08:00
parent 95f103edab
commit 2fb134f3fe

View File

@ -92,7 +92,12 @@ endif()
# Windows MSVC # Windows MSVC
if(MSVC) if(MSVC)
set(QT_CFLAGS_OPTIMIZE "-O2 -Ob3") # -Ob3 was introduced in Visual Studio 2019 version 16.0 set(QT_CFLAGS_OPTIMIZE "-O2")
if(NOT CLANG)
# -Ob3 was introduced in Visual Studio 2019 version 16.0
# However clang-cl can't recognize it.
string(APPEND QT_CFLAGS_OPTIMIZE " -Ob3 ")
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")
set(QT_CFLAGS_OPTIMIZE_VALID_VALUES "/O2" "/O1" "/Od" "/Ob0" "/Ob1" "/Ob2" "/Ob3" "/O0" "-O0") set(QT_CFLAGS_OPTIMIZE_VALID_VALUES "/O2" "/O1" "/Od" "/Ob0" "/Ob1" "/Ob2" "/Ob3" "/O0" "-O0")