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>
bb10
Leander Beernaert 2020-02-20 14:42:57 +01:00
parent 4b611d649e
commit a99d7cf372
1 changed files with 24 additions and 0 deletions

View File

@ -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()