From a99d7cf37213f86c8be55fc80a9785ec9a0d382d Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 20 Feb 2020 14:42:57 +0100 Subject: 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 --- cmake/QtInternalTargets.cmake | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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() -- cgit v1.2.3