aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2019-02-11 15:53:28 +0100
committerMiguel Costa <miguel.costa@qt.io>2019-02-13 11:59:52 +0000
commit5b75c27ee3499f7edda7a6e6f6aaaec2160f0725 (patch)
tree05947874dbf2596d3ebe32be78971962cc0e0ae8
parent971c579fee6caf3009193d440f43df26078689ca (diff)
Add support for VS 2019 platform toolset
The latest version of VS 2019 Preview now includes a new platform toolset (v142). Projects created with VS 2019 should reference this toolset and not the one from VS 2017 (v141). Also, in VS 2019 it's now possible to reference the latest installed version of the Win10 SDK by setting the WindowsTargetPlatformVersion project property to "10.0". Change-Id: Ie8c0f13e27cfdebe8977741cfb098ab3b2cb1919 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/qtprojectlib/BuildConfig.cs4
-rw-r--r--src/qtprojectlib/HelperFunctions.cs7
-rw-r--r--src/vsqml/vsqml.vcxproj26
3 files changed, 24 insertions, 13 deletions
diff --git a/src/qtprojectlib/BuildConfig.cs b/src/qtprojectlib/BuildConfig.cs
index be0e78bc..1aa46c6a 100644
--- a/src/qtprojectlib/BuildConfig.cs
+++ b/src/qtprojectlib/BuildConfig.cs
@@ -39,8 +39,10 @@ namespace QtProjectLib
// TODO: Find a proper way to return the PlatformToolset version.
#if (VS2013 || VS2015)
return version.Replace(".", string.Empty);
-#elif (VS2017 || VS2019)
+#elif VS2017
return "141";
+#elif VS2019
+ return "142";
#else
#error Unknown Visual Studio version!
#endif
diff --git a/src/qtprojectlib/HelperFunctions.cs b/src/qtprojectlib/HelperFunctions.cs
index e5cedf16..5f6c5c99 100644
--- a/src/qtprojectlib/HelperFunctions.cs
+++ b/src/qtprojectlib/HelperFunctions.cs
@@ -1642,6 +1642,12 @@ namespace QtProjectLib
public static string GetWindows10SDKVersion()
{
+#if VS2019
+ // In Visual Studio 2019: WindowsTargetPlatformVersion=10.0
+ // will be treated as "use latest installed Windows 10 SDK".
+ // https://developercommunity.visualstudio.com/comments/407752/view.html
+ return "10.0";
+#else
string versionWin10SDK = HelperFunctions.GetRegistrySoftwareString(
@"Microsoft\Microsoft SDKs\Windows\v10.0", "ProductVersion");
if (string.IsNullOrEmpty(versionWin10SDK))
@@ -1649,6 +1655,7 @@ namespace QtProjectLib
while (versionWin10SDK.Split(new char[] { '.' }).Length < 4)
versionWin10SDK = versionWin10SDK + ".0";
return versionWin10SDK;
+#endif
}
static string _VCPath;
diff --git a/src/vsqml/vsqml.vcxproj b/src/vsqml/vsqml.vcxproj
index ed8ae8a9..c148329f 100644
--- a/src/vsqml/vsqml.vcxproj
+++ b/src/vsqml/vsqml.vcxproj
@@ -10,19 +10,13 @@
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
- <PropertyGroup Condition="'$(VisualStudioVersion)'=='12.0'" Label="Globals">
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <PropertyGroup Condition="'$(VisualStudioVersion)'=='14.0'" Label="Globals">
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <PropertyGroup Condition="'$(VisualStudioVersion)'=='15.0'" Label="Globals">
- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B12702AD-ABFB-343A-A199-8E24837244A3}</ProjectGuid>
<ProjectName>VsQml</ProjectName>
- <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='12.0'">8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='14.0'">8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='15.0'">10.0.17763.0</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='16.0'">10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)'=='12.0' and '$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -41,14 +35,22 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
- <PropertyGroup Condition="('$(VisualStudioVersion)'=='15.0' OR '$(VisualStudioVersion)'=='16.0') and '$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <PropertyGroup Condition="'$(VisualStudioVersion)'=='15.0' and '$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
- <PropertyGroup Condition="('$(VisualStudioVersion)'=='15.0' OR '$(VisualStudioVersion)'=='16.0') and '$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <PropertyGroup Condition="'$(VisualStudioVersion)'=='15.0' and '$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(VisualStudioVersion)'=='16.0' and '$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(VisualStudioVersion)'=='16.0' and '$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />