MSBuild integration: fix the loop in install.bat
authorHans Wennborg <hans@hanshq.net>
Tue, 30 Sep 2014 22:30:06 +0000 (22:30 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 30 Sep 2014 22:30:06 +0000 (22:30 +0000)
It would previously not continue the platforms loop
unless it could find the latest toolset directory.

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

tools/msbuild/install.bat
tools/msbuild/uninstall.bat

index 18057b4d40ff15a74e73b6ff9c9c778c9c73d472..6e321e3f58013a3005e683209a884b9675a60b7f 100644 (file)
@@ -6,13 +6,15 @@ set SUCCESS=0
 REM Change to the directory of this batch file.\r
 cd /d %~dp0\r
 \r
+REM Loop over the two platforms in awkward batch file fashion.\r
 set PLATFORM=None\r
-:START\r
-IF %PLATFORM% == x64 GOTO LOOPEND\r
+:PLATFORMLOOPHEAD\r
+IF %PLATFORM% == x64 GOTO PLATFORMLOOPEND\r
 IF %PLATFORM% == Win32 SET PLATFORM=x64\r
 IF %PLATFORM% == None SET PLATFORM=Win32\r
 \r
 REM Search for the MSBuild toolsets directory.\r
+\r
 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets"\r
 IF EXIST %D% GOTO FOUND_V100\r
 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets"\r
@@ -36,13 +38,18 @@ IF EXIST %D% GOTO FOUND_V140
 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"\r
 IF EXIST %D% GOTO FOUND_V140\r
 \r
-:LOOPEND\r
+:TRY_V150\r
+\r
+GOTO PLATFORMLOOPHEAD\r
+\r
+:PLATFORMLOOPEND\r
 IF %SUCCESS% == 1 goto DONE\r
 echo Failed to find MSBuild toolsets directory.\r
 goto FAILED\r
 \r
 \r
 :FOUND_V100\r
+REM Routine for installing v100 toolchain.\r
 IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props %D%\LLVM-vs2010\r
@@ -53,6 +60,7 @@ set SUCCESS=1
 GOTO TRY_V110\r
 \r
 :FOUND_V110\r
+REM Routine for installing v110 toolchain.\r
 IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props %D%\LLVM-vs2012\r
@@ -69,6 +77,7 @@ set SUCCESS=1
 GOTO TRY_V120\r
 \r
 :FOUND_V120\r
+REM Routine for installing v120 toolchain.\r
 IF NOT EXIST %D%\LLVM-vs2013 mkdir %D%\LLVM-vs2013\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 copy %PLATFORM%\toolset-vs2013.props %D%\LLVM-vs2013\toolset.props\r
@@ -85,6 +94,7 @@ set SUCCESS=1
 GOTO TRY_V140\r
 \r
 :FOUND_V140\r
+REM Routine for installing v140 toolchain.\r
 IF NOT EXIST %D%\LLVM-vs2014 mkdir %D%\LLVM-vs2014\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 copy %PLATFORM%\toolset-vs2014.props %D%\LLVM-vs2014\toolset.props\r
@@ -98,7 +108,7 @@ IF NOT %ERRORLEVEL% == 0 GOTO FAILED
 copy %PLATFORM%\toolset-vs2014_xp.targets %D%\LLVM-vs2014_xp\toolset.targets\r
 IF NOT %ERRORLEVEL% == 0 GOTO FAILED\r
 set SUCCESS=1\r
-GOTO START\r
+GOTO TRY_V150\r
 \r
 \r
 :DONE\r
index ec9fecfc419b14839a73718eac72a86e8be1ec80..c1afae2c3c9694fba9169a4e41c438d75bf90772 100644 (file)
@@ -6,8 +6,8 @@ REM CD to the directory of this batch file.
 cd /d %~dp0\r
 \r
 set PLATFORM=None\r
-:START\r
-IF %PLATFORM% == x64 GOTO END\r
+:LOOPHEAD\r
+IF %PLATFORM% == x64 GOTO LOOPEND\r
 IF %PLATFORM% == Win32 SET PLATFORM=x64\r
 IF %PLATFORM% == None SET PLATFORM=Win32\r
 \r
@@ -67,7 +67,7 @@ IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.targets
 IF EXIST %D%\LLVM-vs2014_xp rmdir %D%\LLVM-vs2014_xp\r
 \r
 \r
-GOTO START\r
+GOTO LOOPHEAD\r
 \r
-:END\r
+:LOOPEND\r
 echo Done!\r