diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-02-20 14:42:57 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-02-20 16:11:02 +0100 |
commit | a99d7cf37213f86c8be55fc80a9785ec9a0d382d (patch) | |
tree | 00e29d42ae5385c36835e8a21aa19775afab01a3 /cmake | |
parent | 4b611d649ede3bd1e56a73abcbd16aa60db38e3b (diff) |
CMake: Add missing compile flags for msvc
This patch adds a couple of missing compile flags that are defined in
mkspecs/common/msvc-version.conf and mkspecs/common/msvc-desktop.conf
that were not yet ported to CMake.
Change-Id: I9ef0ef71cb0c063699fba4c067e90f6515169baf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtInternalTargets.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 2d3b6769cc..5f92252fe4 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -110,3 +110,27 @@ if(APPLE_UIKIT) target_compile_definitions(PlatformCommonInternal INTERFACE QT_COMPILER_SUPPORTS_SSE2) endif() endif() + +# Taken from mkspecs/common/msvc-version.conf and mkspecs/common/msvc-desktop.conf +if (MSVC) + if (MSVC_VERSION GREATER_EQUAL 1799) + target_compile_options(PlatformCommonInternal INTERFACE + -FS + -Zc:rvalueCast + -Zc:inline + ) + endif() + if (MSVC_VERSION GREATER_EQUAL 1899) + target_compile_options(PlatformCommonInternal INTERFACE + -Zc:strictStrings + -Zc:throwingNew + ) + endif() + if (MSVC_VERSION GREATER_EQUAL 1909) + target_compile_options(PlatformCommonInternal INTERFACE + -Zc:referenceBinding + ) + endif() + + target_compile_options(PlatformCommonInternal INTERFACE -Zc:wchar_t -utf-8) +endif() |