vs2013 msbuild integration: add missing .target files, fix typo in CMakeLists
authorHans Wennborg <hans@hanshq.net>
Mon, 14 Oct 2013 18:16:37 +0000 (18:16 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 14 Oct 2013 18:16:37 +0000 (18:16 +0000)
This should fix PR17568.

Patch by Josh Samuel!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192610 91177308-0d34-0410-b5e6-96231b3b80d8

tools/msbuild/CMakeLists.txt
tools/msbuild/toolset-vs2013.targets [new file with mode: 0644]
tools/msbuild/toolset-vs2013_xp.targets [new file with mode: 0644]

index cc4f3d5..c725ab7 100644 (file)
@@ -17,7 +17,7 @@ if (WIN32)
   configure_file(${prop_file_in} ${prop_file_v110})
   set(VS_VERSION "v110_xp")
   configure_file(${prop_file_in} ${prop_file_v110_xp})
-  set(VS_VSERSION "v120")
+  set(VS_VERSION "v120")
   set(MSC_VERSION "1800")
   configure_file(${prop_file_in} ${prop_file_v120})
   set(VS_VERSION "v120_xp")
diff --git a/tools/msbuild/toolset-vs2013.targets b/tools/msbuild/toolset-vs2013.targets
new file mode 100644 (file)
index 0000000..a6efac4
--- /dev/null
@@ -0,0 +1,3 @@
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />\r
+</Project>\r
diff --git a/tools/msbuild/toolset-vs2013_xp.targets b/tools/msbuild/toolset-vs2013_xp.targets
new file mode 100644 (file)
index 0000000..e719681
--- /dev/null
@@ -0,0 +1,21 @@
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <!-- Force TargetFrameworkVersion to v4.0 to support XP-->
+  <PropertyGroup>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <BeforeClCompileTargets>NoSupportCodeAnalysisXP;$(BeforeClCompileTargets)</BeforeClCompileTargets>
+  </PropertyGroup>
+
+  <Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
+
+  <Target Name="NoSupportCodeAnalysisXP" Condition="'$(ErrorNoSupportCodeAnalysisXP)' != 'false'">
+    <VCMessage Condition="'$(DesignTimeBuild)' != 'true' and '@(ClCompile->AnyHaveMetadataValue('EnablePREfast', 'true'))'=='true'" Code="MSB8026" Type="Error"/>
+  </Target>
+
+  <PropertyGroup>
+    <PrepareForBuildDependsOn>CheckWindowsSDK71A;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
+  </PropertyGroup>
+
+  <Target Name="CheckWindowsSDK71A">
+    <VCMessage Code="MSB8003" Type="Warning" Arguments="WindowsSdkDir_71A" Condition="'$(WindowsSdkDir_71A)'=='' and '$(UseEnv)' != 'true'" />
+  </Target>
+</Project>