-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
57 lines (48 loc) · 1.35 KB
/
build.bat
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
@echo off
:: Check if any argument is --no-config
set "no_config=0"
for %%i in (%*) do (
if /I "%%i"=="--no-config" (
set "no_config=1"
)
)
:: Check if any argument is debug or release
set "build_type=debug"
for %%i in (%*) do (
if /I "%%i"=="debug" (
set "build_type=debug"
) else if /I "%%i"=="release" (
set "build_type=release"
)
)
if %no_config%==0 (
.\dependencies\conjure\conjure.exe ninja
)
call :findInstallDir
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
set "build_type=%~1"
call :buildTempest %build_type%
)
exit /b
:findInstallDir
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if not defined InstallDir (
echo "Faied to find vswhere"
exit /b
)
exit /b
:buildTempest
if "%1"=="debug" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
ninja -f Tempest.ninja Debug_x64
) else if "%1"=="release" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
ninja -f Tempest.ninja Release_x64
) else (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
ninja -f Tempest.ninja Debug_x64
ninja -f Tempest.ninja Release_x64
)
exit /b