1@echo off 2 3echo Installing MSVC integration... 4set SUCCESS=0 5 6REM Change to the directory of this batch file. 7cd /d %~dp0 8 9REM Loop over the two platforms in awkward batch file fashion. 10set PLATFORM=None 11:PLATFORMLOOPHEAD 12IF %PLATFORM% == x64 GOTO PLATFORMLOOPEND 13IF %PLATFORM% == Win32 SET PLATFORM=x64 14IF %PLATFORM% == None SET PLATFORM=Win32 15 16REM Search for the MSBuild toolsets directory. 17 18SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" 19IF EXIST %D% GOTO FOUND_V100 20SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" 21IF EXIST %D% GOTO FOUND_V100 22 23:TRY_V110 24SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" 25IF EXIST %D% GOTO FOUND_V110 26SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" 27IF EXIST %D% GOTO FOUND_V110 28 29:TRY_V120 30SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" 31IF EXIST %D% GOTO FOUND_V120 32SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" 33IF EXIST %D% GOTO FOUND_V120 34 35:TRY_V140 36SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" 37IF EXIST %D% GOTO FOUND_V140 38SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" 39IF EXIST %D% GOTO FOUND_V140 40 41:TRY_V150 42 43GOTO PLATFORMLOOPHEAD 44 45:PLATFORMLOOPEND 46IF %SUCCESS% == 1 goto DONE 47echo Failed to find MSBuild toolsets directory. 48goto FAILED 49 50 51:FOUND_V100 52REM Routine for installing v100 toolchain. 53IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010 54IF NOT %ERRORLEVEL% == 0 GOTO FAILED 55copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props %D%\LLVM-vs2010 56IF NOT %ERRORLEVEL% == 0 GOTO FAILED 57copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets %D%\LLVM-vs2010 58IF NOT %ERRORLEVEL% == 0 GOTO FAILED 59set SUCCESS=1 60GOTO TRY_V110 61 62:FOUND_V110 63REM Routine for installing v110 toolchain. 64IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012 65IF NOT %ERRORLEVEL% == 0 GOTO FAILED 66copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props %D%\LLVM-vs2012 67IF NOT %ERRORLEVEL% == 0 GOTO FAILED 68copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets %D%\LLVM-vs2012 69IF NOT %ERRORLEVEL% == 0 GOTO FAILED 70IF NOT EXIST %D%\LLVM-vs2012_xp mkdir %D%\LLVM-vs2012_xp 71IF NOT %ERRORLEVEL% == 0 GOTO FAILED 72copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props %D%\LLVM-vs2012_xp 73IF NOT %ERRORLEVEL% == 0 GOTO FAILED 74copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets %D%\LLVM-vs2012_xp 75IF NOT %ERRORLEVEL% == 0 GOTO FAILED 76set SUCCESS=1 77GOTO TRY_V120 78 79:FOUND_V120 80REM Routine for installing v120 toolchain. 81IF NOT EXIST %D%\LLVM-vs2013 mkdir %D%\LLVM-vs2013 82IF NOT %ERRORLEVEL% == 0 GOTO FAILED 83copy %PLATFORM%\toolset-vs2013.props %D%\LLVM-vs2013\toolset.props 84IF NOT %ERRORLEVEL% == 0 GOTO FAILED 85copy %PLATFORM%\toolset-vs2013.targets %D%\LLVM-vs2013\toolset.targets 86IF NOT %ERRORLEVEL% == 0 GOTO FAILED 87IF NOT EXIST %D%\LLVM-vs2013_xp mkdir %D%\LLVM-vs2013_xp 88IF NOT %ERRORLEVEL% == 0 GOTO FAILED 89copy %PLATFORM%\toolset-vs2013_xp.props %D%\LLVM-vs2013_xp\toolset.props 90IF NOT %ERRORLEVEL% == 0 GOTO FAILED 91copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets 92IF NOT %ERRORLEVEL% == 0 GOTO FAILED 93set SUCCESS=1 94GOTO TRY_V140 95 96:FOUND_V140 97REM Routine for installing v140 toolchain. 98IF NOT EXIST %D%\LLVM-vs2014 mkdir %D%\LLVM-vs2014 99IF NOT %ERRORLEVEL% == 0 GOTO FAILED 100copy %PLATFORM%\toolset-vs2014.props %D%\LLVM-vs2014\toolset.props 101IF NOT %ERRORLEVEL% == 0 GOTO FAILED 102copy %PLATFORM%\toolset-vs2014.targets %D%\LLVM-vs2014\toolset.targets 103IF NOT %ERRORLEVEL% == 0 GOTO FAILED 104IF NOT EXIST %D%\LLVM-vs2014_xp mkdir %D%\LLVM-vs2014_xp 105IF NOT %ERRORLEVEL% == 0 GOTO FAILED 106copy %PLATFORM%\toolset-vs2014_xp.props %D%\LLVM-vs2014_xp\toolset.props 107IF NOT %ERRORLEVEL% == 0 GOTO FAILED 108copy %PLATFORM%\toolset-vs2014_xp.targets %D%\LLVM-vs2014_xp\toolset.targets 109IF NOT %ERRORLEVEL% == 0 GOTO FAILED 110set SUCCESS=1 111GOTO TRY_V150 112 113 114:DONE 115echo Done! 116goto END 117 118:FAILED 119echo MSVC integration install failed. 120pause 121goto END 122 123:END 124