forked from microsoft/cpp_client_telemetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-buildtools.cmd
67 lines (56 loc) · 1.71 KB
/
setup-buildtools.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
REM @echo off
set "PATH=%PATH%;%~dp0;%~dp0\vcpkg"
pushd %~dp0
REM Fail if chocolatey is not installed
where /Q choco
if ERRORLEVEL 1 (
echo This script requires chocolatey. Installation instructions: https://chocolatey.org/docs/installation
exit -1
)
REM Print current Visual Studio installations detected
where /Q vswhere
if ERRORLEVEL 0 (
echo Visual Studio installations detected:
vswhere -property installationPath
)
REM Install tools needed to build SDK with either Visual Studio or CMake
choco install -y cmake svn git llvm zip
REM Try to autodetect Visual Studio
call "%~dp0\vcvars.cmd"
if "%VSTOOLS_NOTFOUND%" == "1" (
REM Cannot detect MSBuild path
REM TODO: no command line tools..
REM TODO: use MSBuild from vswhere?
)
echo Visual Studio installation directory:
echo %VSINSTALLDIR%
set "VSINSTALLER=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe"
if NOT exist "%VSINSTALLER%" (
call download.cmd https://aka.ms/vs/16/release/vs_buildtools.exe
set VSINSTALLER=vs_buildtools.exe
)
echo Visual Studio installer:
echo %VSINSTALLER%
REM Install optional components required for ARM build - vs2017-BuildTools
if exist "%VSINSTALLDIR%" (
echo Running Visual Studio installer..
"%VSINSTALLER%" modify --installPath "%VSINSTALLDIR%" --config "%~dp0\.vsconfig.%VSVERSION%" --force --quiet --norestart
)
where /Q vcpkg.exe
if ERRORLEVEL 1 (
REM Build our own vcpkg from source
pushd .\vcpkg
call bootstrap-vcpkg.bat
popd
)
REM Install it
vcpkg install gtest:x64-windows
vcpkg install --overlay-ports=%~dp0\ports benchmark:x64-windows
vcpkg install ms-gsl:x64-windows
if DEFINED INSTALL_LLVM (
REM Required for LLVM Clang build on Windows
call install-llvm.cmd
)
:end
popd
exit /b 0