forked from NVIDIAGameWorks/Streamline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
64 lines (56 loc) · 1.6 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
58
59
60
61
62
63
64
@echo off
setlocal
if exist .\_project\vs2019\streamline.sln (
rem find VS 2019
for /f "usebackq tokens=1* delims=: " %%i in (`.\tools\vswhere.exe -version [16^,17^) -requires Microsoft.VisualStudio.Workload.NativeDesktop`) do (
if /i "%%i"=="installationPath" set VS_PATH=%%j
)
) else (
rem find VS 2017
for /f "usebackq tokens=1* delims=: " %%i in (`.\tools\vswhere.exe -version [15^,16^) -requires Microsoft.VisualStudio.Workload.NativeDesktop`) do (
if /i "%%i"=="installationPath" set VS_PATH=%%j
)
)
echo off
set cfg=Debug
set bld=Clean,Build
:loop
IF NOT "%1"=="" (
IF "%1"=="-debug" (
SET cfg=Debug
SHIFT
)
IF "%1"=="-release" (
SET cfg=Release
SHIFT
)
IF "%1"=="-production" (
SET cfg=Production
SHIFT
)
IF "%1"=="-profiling" (
SET cfg=Profiling
SHIFT
)
IF "%1"=="-relextdev" (
SET cfg=RelExtDev
SHIFT
)
SHIFT
GOTO :loop
)
if not exist "%VS_PATH%" (
echo "%VS_PATH%" not found. Is Visual Studio installed? && goto :ErrorExit
)
for /f "delims=" %%F in ('dir /b /s "%VS_PATH%\vsdevcmd.bat" 2^>nul') do set VSDEVCMD_PATH=%%F
echo ********Executing %VSDEVCMD_PATH%********
call "%VSDEVCMD_PATH%"
goto :SetVSEnvFinished
:ErrorExit
exit /b 1
:SetVSEnvFinished
if exist .\_project\vs2019\streamline.sln (
msbuild .\_project\vs2019\streamline.sln /t:%bld% /property:Configuration=%cfg%
) else (
msbuild .\_project\vs2017\streamline.sln /t:%bld% /property:Configuration=%cfg%
)