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