-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
33 lines (25 loc) · 1012 Bytes
/
build.bat
File metadata and controls
33 lines (25 loc) · 1012 Bytes
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
@echo off
setlocal enableextensions
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (
echo vswhere not found. Install Visual Studio Build Tools or Community with C++ workload.
exit /b 1
)
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%i"
if not defined VSINSTALL (
echo MSVC build tools not found. Install the C++ workload.
exit /b 1
)
call "%VSINSTALL%\Common7\Tools\VsDevCmd.bat" -no_logo -arch=x64 -host_arch=x64
if errorlevel 1 (
echo Failed to initialize MSVC environment.
exit /b 1
)
if not exist "build" mkdir build
rc /nologo /fo build\app.res resources\app.rc
if errorlevel 1 (
echo Resource compilation failed.
exit /b 1
)
cl /EHsc /std:c++17 /utf-8 /I third_party\sqlite src\main.cpp third_party\sqlite\sqlite3.c build\app.res /Fo:build\ /Fe:build\cpp-gradebook.exe
exit /b %errorlevel%