-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathBuildRelease.ps1
More file actions
27 lines (20 loc) · 914 Bytes
/
BuildRelease.ps1
File metadata and controls
27 lines (20 loc) · 914 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
param(
[string]$preset = "release",
[int]$threads = 8
)
$vsDevShellPath = "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/Launch-VsDevShell.ps1"
# Load in local variable overrides
# local developer copy of Build_Config_Template.ps1 to override $vsDevShellPath or other variables if needed
if (Test-Path .\Build_Config_Local.ps1) {
. .\Build_Config_Local.ps1
}
# Save current directory, launch VS dev shell, and return to original directory
$currentDirectory = $PWD.Path
& $vsDevShellPath -Arch amd64; Set-Location -Path "${currentDirectory}"
Write-Host "Running preset $preset"
# Build cmake configure arguments
$cmakeArgs = @("-S", ".", "--preset=$preset", "-DCMAKE_COMPILE_JOBS=$threads", "-Wno-dev")
& cmake $cmakeArgs
if ($LASTEXITCODE -ne 0) { exit 1 }
& cmake --build --preset=$preset --parallel $threads
if ($LASTEXITCODE -ne 0) { exit 1 }