Add a VS "14" msbuild toolset

This allows people to try clang inside MSBuild with the VS "14" CTP
releases.

Fixes PR20341.

Patch by Marcel Raad!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213819 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner 2014-07-23 23:49:16 +00:00
parent 4cae9cb034
commit ec6e535168
5 changed files with 75 additions and 0 deletions

View File

@ -10,6 +10,8 @@ if (WIN32)
set(prop_file_v110_xp "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.props") set(prop_file_v110_xp "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.props")
set(prop_file_v120 "toolset-vs2013.props") set(prop_file_v120 "toolset-vs2013.props")
set(prop_file_v120_xp "toolset-vs2013_xp.props") set(prop_file_v120_xp "toolset-vs2013_xp.props")
set(prop_file_v140 "toolset-vs2014.props")
set(prop_file_v140_xp "toolset-vs2014_xp.props")
if (platform STREQUAL "Win32") if (platform STREQUAL "Win32")
set(mflag "m32") set(mflag "m32")
@ -29,6 +31,11 @@ if (WIN32)
configure_file(${prop_file_in} ${platform}/${prop_file_v120}) configure_file(${prop_file_in} ${platform}/${prop_file_v120})
set(VS_VERSION "v120_xp") set(VS_VERSION "v120_xp")
configure_file(${prop_file_in} ${platform}/${prop_file_v120_xp}) configure_file(${prop_file_in} ${platform}/${prop_file_v120_xp})
set(VS_VERSION "v140")
set(MSC_VERSION "1900")
configure_file(${prop_file_in} ${platform}/${prop_file_v140})
set(VS_VERSION "v140_xp")
configure_file(${prop_file_in} ${platform}/${prop_file_v140_xp})
set(VS_VERSION) set(VS_VERSION)
set(MSC_VERSION) set(MSC_VERSION)
set(mflag) set(mflag)
@ -38,12 +45,16 @@ if (WIN32)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110_xp}" DESTINATION tools/msbuild/${platform}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110_xp}" DESTINATION tools/msbuild/${platform})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120}" DESTINATION tools/msbuild/${platform}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120}" DESTINATION tools/msbuild/${platform})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120_xp}" DESTINATION tools/msbuild/${platform}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120_xp}" DESTINATION tools/msbuild/${platform})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140}" DESTINATION tools/msbuild/${platform})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140_xp}" DESTINATION tools/msbuild/${platform})
install(FILES "Microsoft.Cpp.Win32.LLVM-vs2010.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2010.targets") install(FILES "Microsoft.Cpp.Win32.LLVM-vs2010.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2010.targets")
install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012.targets") install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012.targets")
install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.targets") install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.targets")
install(FILES "toolset-vs2013.targets" DESTINATION "tools/msbuild/${platform}") install(FILES "toolset-vs2013.targets" DESTINATION "tools/msbuild/${platform}")
install(FILES "toolset-vs2013_xp.targets" DESTINATION "tools/msbuild/${platform}") install(FILES "toolset-vs2013_xp.targets" DESTINATION "tools/msbuild/${platform}")
install(FILES "toolset-vs2014.targets" DESTINATION "tools/msbuild/${platform}")
install(FILES "toolset-vs2014_xp.targets" DESTINATION "tools/msbuild/${platform}")
endforeach() endforeach()
set(LIB_PATH_VERSION) set(LIB_PATH_VERSION)

View File

@ -30,6 +30,12 @@ IF EXIST %D% GOTO FOUND_V120
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets"
IF EXIST %D% GOTO FOUND_V120 IF EXIST %D% GOTO FOUND_V120
:TRY_V140
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
IF EXIST %D% GOTO FOUND_V140
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
IF EXIST %D% GOTO FOUND_V140
:LOOPEND :LOOPEND
IF %SUCCESS% == 1 goto DONE IF %SUCCESS% == 1 goto DONE
echo Failed to find MSBuild toolsets directory. echo Failed to find MSBuild toolsets directory.
@ -76,6 +82,22 @@ IF NOT %ERRORLEVEL% == 0 GOTO FAILED
copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets
IF NOT %ERRORLEVEL% == 0 GOTO FAILED IF NOT %ERRORLEVEL% == 0 GOTO FAILED
set SUCCESS=1 set SUCCESS=1
GOTO TRY_V140
:FOUND_V140
IF NOT EXIST %D%\LLVM-vs2014 mkdir %D%\LLVM-vs2014
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
copy %PLATFORM%\toolset-vs2014.props %D%\LLVM-vs2014\toolset.props
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
copy %PLATFORM%\toolset-vs2014.targets %D%\LLVM-vs2014\toolset.targets
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
IF NOT EXIST %D%\LLVM-vs2014_xp mkdir %D%\LLVM-vs2014_xp
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
copy %PLATFORM%\toolset-vs2014_xp.props %D%\LLVM-vs2014_xp\toolset.props
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
copy %PLATFORM%\toolset-vs2014_xp.targets %D%\LLVM-vs2014_xp\toolset.targets
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
set SUCCESS=1
GOTO START GOTO START

View File

@ -0,0 +1,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
</Project>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
</Project>

View File

@ -0,0 +1,21 @@
<Project ToolsVersion="14.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>

View File

@ -51,6 +51,21 @@ IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.props
IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.targets IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.targets
IF EXIST %D%\LLVM-vs2013_xp rmdir %D%\LLVM-vs2013_xp IF EXIST %D%\LLVM-vs2013_xp rmdir %D%\LLVM-vs2013_xp
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.props
IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.targets
IF EXIST %D%\LLVM-vs2014 rmdir %D%\LLVM-vs2014
IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.props
IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.targets
IF EXIST %D%\LLVM-vs2014_xp rmdir %D%\LLVM-vs2014_xp
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.props
IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.targets
IF EXIST %D%\LLVM-vs2014 rmdir %D%\LLVM-vs2014
IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.props
IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.targets
IF EXIST %D%\LLVM-vs2014_xp rmdir %D%\LLVM-vs2014_xp
GOTO START GOTO START