comparison tools/msbuild/install.bat @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 60c9769439b8
children
comparison
equal deleted inserted replaced
134:3a76565eade5 147:c2174574ed3a
1 @echo off 1 @echo off
2 2
3 echo Installing MSVC integration... 3 echo Installing MSVC integration...
4 set SUCCESS=0 4 set SUCCESS=0
5 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
6 REM Change to the directory of this batch file. 10 REM Change to the directory of this batch file.
7 cd /d %~dp0 11 cd /d %~dp0
8 12
9 REM Loop over the two platforms in awkward batch file fashion. 13 REM Older versions of VS would look for these files in the Program Files\MSBuild directory
10 set PLATFORM=None 14 REM but with VS2017 it seems to look for these directly in the Visual Studio instance.
11 :PLATFORMLOOPHEAD 15 REM This means we'll need to do a little extra work to properly detect all the various
12 IF %PLATFORM% == x64 GOTO PLATFORMLOOPEND 16 REM instances, but in reality we can probably sidestep all of this by just wrapping this
13 IF %PLATFORM% == Win32 SET PLATFORM=x64 17 REM in a vsix and calling it a day, as that should handle everything for us.
14 IF %PLATFORM% == None SET PLATFORM=Win32 18 SET VCTargets=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets
15 19
16 REM Search for the MSBuild toolsets directory. 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
17 25
18 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" 26 ECHO Installing x64 Platform Toolset
19 IF EXIST %D% GOTO FOUND_V100 27 SET PlatformToolsets=%VCTargets%\Platforms\x64\PlatformToolsets
20 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" 28 IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm"
21 IF EXIST %D% GOTO FOUND_V100 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
22 34
23 :TRY_V110 35 ECHO Installing Win32 Platform Toolset
24 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" 36 SET PlatformToolsets=%VCTargets%\Platforms\Win32\PlatformToolsets
25 IF EXIST %D% GOTO FOUND_V110 37 IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm"
26 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" 38 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
27 IF EXIST %D% GOTO FOUND_V110 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
28 43
29 :TRY_V120 44 ECHO Installing C++ Settings UI
30 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" 45 copy llvm-general.xml "%VCTargets%\1033"
31 IF EXIST %D% GOTO FOUND_V120
32 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets"
33 IF EXIST %D% GOTO FOUND_V120
34
35 :TRY_V140
36 SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
37 IF EXIST %D% GOTO FOUND_V140
38 SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets"
39 IF EXIST %D% GOTO FOUND_V140
40
41 :TRY_V150
42
43 GOTO PLATFORMLOOPHEAD
44
45 :PLATFORMLOOPEND
46 IF %SUCCESS% == 1 goto DONE
47 echo Failed to find MSBuild toolsets directory.
48 goto FAILED
49
50
51 :FOUND_V100
52 REM Routine for installing v100 toolchain.
53 IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010
54 IF NOT %ERRORLEVEL% == 0 GOTO FAILED 46 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
55 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props %D%\LLVM-vs2010
56 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
57 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets %D%\LLVM-vs2010
58 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
59 set SUCCESS=1
60 GOTO TRY_V110
61
62 :FOUND_V110
63 REM Routine for installing v110 toolchain.
64 IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012
65 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
66 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props %D%\LLVM-vs2012
67 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
68 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets %D%\LLVM-vs2012
69 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
70 IF NOT EXIST %D%\LLVM-vs2012_xp mkdir %D%\LLVM-vs2012_xp
71 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
72 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props %D%\LLVM-vs2012_xp
73 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
74 copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets %D%\LLVM-vs2012_xp
75 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
76 set SUCCESS=1
77 GOTO TRY_V120
78
79 :FOUND_V120
80 REM Routine for installing v120 toolchain.
81 IF NOT EXIST %D%\LLVM-vs2013 mkdir %D%\LLVM-vs2013
82 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
83 copy %PLATFORM%\toolset-vs2013.props %D%\LLVM-vs2013\toolset.props
84 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
85 copy %PLATFORM%\toolset-vs2013.targets %D%\LLVM-vs2013\toolset.targets
86 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
87 IF NOT EXIST %D%\LLVM-vs2013_xp mkdir %D%\LLVM-vs2013_xp
88 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
89 copy %PLATFORM%\toolset-vs2013_xp.props %D%\LLVM-vs2013_xp\toolset.props
90 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
91 copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets
92 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
93 set SUCCESS=1
94 GOTO TRY_V140
95
96 :FOUND_V140
97 REM Routine for installing v140 toolchain.
98 IF NOT EXIST %D%\LLVM-vs2014 mkdir %D%\LLVM-vs2014
99 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
100 copy %PLATFORM%\toolset-vs2014.props %D%\LLVM-vs2014\toolset.props
101 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
102 copy %PLATFORM%\toolset-vs2014.targets %D%\LLVM-vs2014\toolset.targets
103 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
104 IF NOT EXIST %D%\LLVM-vs2014_xp mkdir %D%\LLVM-vs2014_xp
105 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
106 copy %PLATFORM%\toolset-vs2014_xp.props %D%\LLVM-vs2014_xp\toolset.props
107 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
108 copy %PLATFORM%\toolset-vs2014_xp.targets %D%\LLVM-vs2014_xp\toolset.targets
109 IF NOT %ERRORLEVEL% == 0 GOTO FAILED
110 set SUCCESS=1
111 GOTO TRY_V150
112
113 47
114 :DONE 48 :DONE
115 echo Done! 49 echo Done!
116 goto END 50 goto END
117 51