OSDN Git Service

Pull out repeated CI->getCalledFunction() calls. NFCI.
[android-x86/external-llvm.git] / tools / msbuild / install.bat
1 @echo off
2
3 echo Installing MSVC integration...
4 set SUCCESS=0
5
6 REM In general this script should not be used except for development and testing
7 REM purposes.  The proper way to install is via the VSIX, and the proper way to
8 REM uninstall is through the Visual Studio extension manager.
9
10 REM Change to the directory of this batch file.
11 cd /d %~dp0
12
13 REM Older versions of VS would look for these files in the Program Files\MSBuild directory
14 REM but with VS2017 it seems to look for these directly in the Visual Studio instance.
15 REM This means we'll need to do a little extra work to properly detect all the various
16 REM instances, but in reality we can probably sidestep all of this by just wrapping this
17 REM in a vsix and calling it a day, as that should handle everything for us.
18 SET VCTargets=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets
19
20 ECHO Installing Common Files
21 copy LLVM.Cpp.Common.props "%VCTargets%"
22 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
23 copy LLVM.Cpp.Common.targets "%VCTargets%"
24 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
25
26 ECHO Installing x64 Platform Toolset
27 SET PlatformToolsets=%VCTargets%\Platforms\x64\PlatformToolsets
28 IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm"
29 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
30 copy PlatformX64\Toolset.props "%PlatformToolsets%\llvm"
31 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
32 copy PlatformX64\Toolset.targets "%PlatformToolsets%\llvm"
33 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
34
35 ECHO Installing Win32 Platform Toolset
36 SET PlatformToolsets=%VCTargets%\Platforms\Win32\PlatformToolsets
37 IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm"
38 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
39 copy PlatformX86\Toolset.props "%PlatformToolsets%\llvm"
40 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
41 copy PlatformX86\Toolset.targets "%PlatformToolsets%\llvm"
42 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
43
44 ECHO Installing C++ Settings UI
45 copy llvm-general.xml "%VCTargets%\1033"
46 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
47
48 :DONE
49 echo Done!
50 goto END
51
52 :FAILED
53 echo MSVC integration install failed.
54 pause
55 goto END
56
57 :END