2013-08-28 09:19:26 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
echo Installing MSVC integration...
|
2013-09-07 01:05:46 +08:00
|
|
|
set SUCCESS=0
|
2013-08-28 09:19:26 +08:00
|
|
|
|
|
|
|
REM Change to the directory of this batch file.
|
|
|
|
cd /d %~dp0
|
|
|
|
|
2014-10-01 06:30:06 +08:00
|
|
|
REM Loop over the two platforms in awkward batch file fashion.
|
2014-02-13 07:26:29 +08:00
|
|
|
set PLATFORM=None
|
2014-10-01 06:30:06 +08:00
|
|
|
:PLATFORMLOOPHEAD
|
|
|
|
IF %PLATFORM% == x64 GOTO PLATFORMLOOPEND
|
2014-02-13 07:26:29 +08:00
|
|
|
IF %PLATFORM% == Win32 SET PLATFORM=x64
|
|
|
|
IF %PLATFORM% == None SET PLATFORM=Win32
|
|
|
|
|
2013-08-28 09:19:26 +08:00
|
|
|
REM Search for the MSBuild toolsets directory.
|
2014-10-01 06:30:06 +08:00
|
|
|
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-09-07 01:05:46 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V100
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-09-07 01:05:46 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V100
|
2013-08-28 09:19:26 +08:00
|
|
|
|
2013-09-07 01:05:46 +08:00
|
|
|
:TRY_V110
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-09-07 01:05:46 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V110
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-09-07 01:05:46 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V110
|
|
|
|
|
2013-10-11 01:32:01 +08:00
|
|
|
:TRY_V120
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-10-11 01:32:01 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V120
|
2014-02-13 07:26:29 +08:00
|
|
|
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets"
|
2013-10-11 01:32:01 +08:00
|
|
|
IF EXIST %D% GOTO FOUND_V120
|
|
|
|
|
2014-07-24 07:49:16 +08:00
|
|
|
: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
|
|
|
|
|
2014-10-01 06:30:06 +08:00
|
|
|
:TRY_V150
|
|
|
|
|
|
|
|
GOTO PLATFORMLOOPHEAD
|
|
|
|
|
|
|
|
:PLATFORMLOOPEND
|
2013-10-11 01:31:54 +08:00
|
|
|
IF %SUCCESS% == 1 goto DONE
|
|
|
|
echo Failed to find MSBuild toolsets directory.
|
|
|
|
goto FAILED
|
2013-08-28 09:19:26 +08:00
|
|
|
|
|
|
|
|
2013-09-07 01:05:46 +08:00
|
|
|
:FOUND_V100
|
2014-10-01 06:30:06 +08:00
|
|
|
REM Routine for installing v100 toolchain.
|
2013-09-07 01:05:46 +08:00
|
|
|
IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010
|
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props %D%\LLVM-vs2010
|
2013-08-28 09:19:26 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets %D%\LLVM-vs2010
|
2013-08-28 09:19:26 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2013-09-07 01:05:46 +08:00
|
|
|
set SUCCESS=1
|
|
|
|
GOTO TRY_V110
|
2013-08-28 09:19:26 +08:00
|
|
|
|
2013-09-07 01:05:46 +08:00
|
|
|
:FOUND_V110
|
2014-10-01 06:30:06 +08:00
|
|
|
REM Routine for installing v110 toolchain.
|
2013-09-07 01:05:46 +08:00
|
|
|
IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012
|
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props %D%\LLVM-vs2012
|
2013-09-07 01:05:46 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets %D%\LLVM-vs2012
|
2013-09-07 01:05:46 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2013-09-20 00:50:40 +08:00
|
|
|
IF NOT EXIST %D%\LLVM-vs2012_xp mkdir %D%\LLVM-vs2012_xp
|
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props %D%\LLVM-vs2012_xp
|
2013-09-20 00:50:40 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets %D%\LLVM-vs2012_xp
|
2013-09-20 00:50:40 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2013-10-11 01:32:01 +08:00
|
|
|
set SUCCESS=1
|
|
|
|
GOTO TRY_V120
|
|
|
|
|
|
|
|
:FOUND_V120
|
2014-10-01 06:30:06 +08:00
|
|
|
REM Routine for installing v120 toolchain.
|
2013-10-11 01:32:01 +08:00
|
|
|
IF NOT EXIST %D%\LLVM-vs2013 mkdir %D%\LLVM-vs2013
|
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\toolset-vs2013.props %D%\LLVM-vs2013\toolset.props
|
2013-10-11 01:32:01 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\toolset-vs2013.targets %D%\LLVM-vs2013\toolset.targets
|
2013-10-11 01:32:01 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
|
|
|
IF NOT EXIST %D%\LLVM-vs2013_xp mkdir %D%\LLVM-vs2013_xp
|
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\toolset-vs2013_xp.props %D%\LLVM-vs2013_xp\toolset.props
|
2013-10-11 01:32:01 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-02-13 07:26:29 +08:00
|
|
|
copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets
|
2013-10-11 01:32:01 +08:00
|
|
|
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
|
2014-03-25 01:33:22 +08:00
|
|
|
set SUCCESS=1
|
2014-07-24 07:49:16 +08:00
|
|
|
GOTO TRY_V140
|
|
|
|
|
|
|
|
:FOUND_V140
|
2014-10-01 06:30:06 +08:00
|
|
|
REM Routine for installing v140 toolchain.
|
2014-07-24 07:49:16 +08:00
|
|
|
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
|
2014-10-01 06:30:06 +08:00
|
|
|
GOTO TRY_V150
|
2014-02-13 07:26:29 +08:00
|
|
|
|
2013-10-11 01:31:54 +08:00
|
|
|
|
|
|
|
:DONE
|
2013-08-28 09:19:26 +08:00
|
|
|
echo Done!
|
|
|
|
goto END
|
|
|
|
|
|
|
|
:FAILED
|
|
|
|
echo MSVC integration install failed.
|
|
|
|
pause
|
|
|
|
goto END
|
|
|
|
|
|
|
|
:END
|