diff options
author | Yuhang Zhao <2546789017@qq.com> | 2020-11-02 12:36:14 +0800 |
---|---|---|
committer | Yuhang Zhao <2546789017@qq.com> | 2020-11-02 20:06:22 +0800 |
commit | 4b694032dfe61dd9190170d15ee2edddbc9dfd7c (patch) | |
tree | 9e5d0917fd7e56d1324e0037bed13771230c73a5 /cmake/QtCompilerOptimization.cmake | |
parent | 2b4a581f34854d9c0bb8d53626d929abd0661bd8 (diff) |
Improve clang-cl support for Qt6
1. clang-cl doesn't support "-fno-exceptions", it uses msvc's parameter.
2. some parameters supported by msvc are not supported by clang-cl
and they are causing huge warning message flood, don't add them.
3. use correct optimize parameter for clang-cl.
Change-Id: Idbadf139127143c5fa6c49068588cb26f47da7a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtCompilerOptimization.cmake')
-rw-r--r-- | cmake/QtCompilerOptimization.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtCompilerOptimization.cmake b/cmake/QtCompilerOptimization.cmake index 2e98dc31c2..333cbf3f15 100644 --- a/cmake/QtCompilerOptimization.cmake +++ b/cmake/QtCompilerOptimization.cmake @@ -158,6 +158,11 @@ if(MSVC) set(QT_CFLAGS_OPTIMIZE_DEBUG "-Od") set(QT_CFLAGS_OPTIMIZE_SIZE "-O1") set(QT_CFLAGS_OPTIMIZE_VALID_VALUES "/O2" "/O1" "/Od" "/Ob0" "/Ob1" "/Ob2" "/O0" "-O0") + + if(CLANG) + set(QT_CFLAGS_OPTIMIZE_FULL "/clang:-O3") + set(QT_CFLAGS_OPTIMIZE_SIZE "/clang:-Oz") + endif() endif() # Android Clang |