diff options
author | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-05-08 16:19:35 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-11 17:58:25 +0000 |
commit | e3cc2487ce63cae42d8054b38fdb54abe8545007 (patch) | |
tree | f1237ecce27c4d9342c25975de021e46b119babe | |
parent | ff580c2014d260732ab5f21e14a9845ebcee1302 (diff) | |
download | qtbase-e3cc2487ce63cae42d8054b38fdb54abe8545007.tar.gz |
Make sure that -Zc:__cplusplus, and -permissive- only apply to MSVC
As described in the bug report, in cases where host Qt is built using
MSVC, these flags may leak to user projects if they are set to be
configured by a different compiler, e.g., Clang.
Fixes: QTBUG-112737
Change-Id: Iad922e24cc7e7f835e08ed37271dfbedc6e38dbe
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit b0f78c22bde854ee34f8e2b6d219e82759f55e53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index d8597326cc..3832aedabd 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -287,7 +287,8 @@ function(qt_set_msvc_cplusplus_options target visibility) # Check qt_config_compile_test for more info. if(MSVC AND MSVC_VERSION GREATER_EQUAL 1913) set(flags "-Zc:__cplusplus" "-permissive-") - target_compile_options("${target}" ${visibility} "$<$<COMPILE_LANGUAGE:CXX>:${flags}>") + target_compile_options("${target}" ${visibility} + "$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>>:${flags}>") endif() endfunction() |