From 2de13f620d0356761f1a0c143b7ed5538876f922 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 23 Jul 2014 23:49:16 +0000 Subject: [PATCH] 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! llvm-svn: 213819 --- llvm/tools/msbuild/CMakeLists.txt | 11 +++++++++++ llvm/tools/msbuild/install.bat | 22 ++++++++++++++++++++++ llvm/tools/msbuild/toolset-vs2014.targets | 6 ++++++ llvm/tools/msbuild/toolset-vs2014_xp.targets | 21 +++++++++++++++++++++ llvm/tools/msbuild/uninstall.bat | 15 +++++++++++++++ 5 files changed, 75 insertions(+) create mode 100644 llvm/tools/msbuild/toolset-vs2014.targets create mode 100644 llvm/tools/msbuild/toolset-vs2014_xp.targets diff --git a/llvm/tools/msbuild/CMakeLists.txt b/llvm/tools/msbuild/CMakeLists.txt index b7be71d..4f471e5 100644 --- a/llvm/tools/msbuild/CMakeLists.txt +++ b/llvm/tools/msbuild/CMakeLists.txt @@ -10,6 +10,8 @@ if (WIN32) set(prop_file_v110_xp "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.props") set(prop_file_v120 "toolset-vs2013.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") set(mflag "m32") @@ -29,6 +31,11 @@ if (WIN32) configure_file(${prop_file_in} ${platform}/${prop_file_v120}) set(VS_VERSION "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(MSC_VERSION) 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_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_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-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 "toolset-vs2013.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() set(LIB_PATH_VERSION) diff --git a/llvm/tools/msbuild/install.bat b/llvm/tools/msbuild/install.bat index 9880fb2..18057b4 100644 --- a/llvm/tools/msbuild/install.bat +++ b/llvm/tools/msbuild/install.bat @@ -30,6 +30,12 @@ IF EXIST %D% GOTO FOUND_V120 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" 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 IF %SUCCESS% == 1 goto DONE 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 IF NOT %ERRORLEVEL% == 0 GOTO FAILED 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 diff --git a/llvm/tools/msbuild/toolset-vs2014.targets b/llvm/tools/msbuild/toolset-vs2014.targets new file mode 100644 index 0000000..fd09c4f --- /dev/null +++ b/llvm/tools/msbuild/toolset-vs2014.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/llvm/tools/msbuild/toolset-vs2014_xp.targets b/llvm/tools/msbuild/toolset-vs2014_xp.targets new file mode 100644 index 0000000..eec4f18 --- /dev/null +++ b/llvm/tools/msbuild/toolset-vs2014_xp.targets @@ -0,0 +1,21 @@ + + + + v4.0 + NoSupportCodeAnalysisXP;$(BeforeClCompileTargets) + + + + + + + + + + CheckWindowsSDK71A;$(PrepareForBuildDependsOn) + + + + + + diff --git a/llvm/tools/msbuild/uninstall.bat b/llvm/tools/msbuild/uninstall.bat index b0bc943..ec9fecf 100644 --- a/llvm/tools/msbuild/uninstall.bat +++ b/llvm/tools/msbuild/uninstall.bat @@ -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 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 -- 2.7.4