-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.bat
More file actions
26 lines (21 loc) · 877 Bytes
/
Build.bat
File metadata and controls
26 lines (21 loc) · 877 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
@echo off
setlocal enabledelayedexpansion
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
) else (
if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
) else (
echo [ERROR] vswhere.exe not found. Is Visual Studio installed?
exit /b 1
)
)
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
set "MSBUILD_PATH=%%i"
)
if not defined MSBUILD_PATH (
echo [ERROR] MSBuild not found! Ensure the C++ workload is installed.
exit /b 1
)
echo [INFO] Found MSBuild at: "!MSBUILD_PATH!"
"%MSBUILD_PATH%" %*