forked from NicholasSlattery/sony-head-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cmd
More file actions
46 lines (42 loc) · 1.51 KB
/
Copy pathbuild.cmd
File metadata and controls
46 lines (42 loc) · 1.51 KB
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
@echo off
rem Build sony-head-tracker.exe from the modular sources under src\ + include\.
rem Run this from any normal Command Prompt -- it finds Visual Studio's C++ tools
rem automatically. (Or run it from a "x64 Native Tools Command Prompt for VS".)
setlocal
where cl >nul 2>nul && goto build
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (
echo Could not find Visual Studio. Install "Desktop development with C++",
echo or open a "x64 Native Tools Command Prompt for VS" and run this script there.
exit /b 1
)
rem Put the Installer dir on PATH so vswhere can be called without a quoted path
rem (a leading quote confuses "for /f").
set "PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer;%PATH%"
set "VSPATH="
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSPATH=%%i"
if not defined VSPATH (
echo Visual Studio with the C++ toolset was not found.
exit /b 1
)
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" >nul
:build
rc /nologo app.rc
if not %errorlevel%==0 (
echo.
echo Resource compile failed.
exit /b 1
)
if not exist build md build
cl /nologo /std:c++latest /EHsc /permissive- /utf-8 /O2 /W4 /DUNICODE /D_UNICODE /I include /Fobuild\ ^
src\*.cpp app.res /Fe:sony-head-tracker.exe
if %errorlevel%==0 (
del /q app.res >nul 2>nul
echo.
echo Built sony-head-tracker.exe
) else (
echo.
echo Build failed.
exit /b 1
)
endlocal