forked from shanepowell/DbgHelpUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
34 lines (28 loc) · 938 Bytes
/
build.ps1
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
Param
(
[ValidateSet("vs2019", "vs2022")][string]$Compiler = "vs2022",
[switch]$GenerateBuildFileOnly,
[switch]$Clean
)
$compilers = @{
"vs2019" = "Visual Studio 16 2019";
"vs2022" = "Visual Studio 17 2022";
}
if($Clean)
{
Remove-Item -Force -Recurse -ErrorAction SilentlyContinue x86
Remove-Item -Force -Recurse -ErrorAction SilentlyContinue x64
Remove-Item -Force -Recurse -ErrorAction SilentlyContinue build
}
Write-Host Generate build files
cmake -S . -B build/$($Compiler)x64 -G $compilers[$Compiler] -A x64
cmake -S . -B build/$($Compiler)x86 -G $compilers[$Compiler] -A win32
if(!$GenerateBuildFileOnly)
{
Write-Host Build all targets
cmake --build .\build\$($Compiler)x64 --config Debug
cmake --build .\build\$($Compiler)x64 --config Release
cmake --build .\build\$($Compiler)x86 --config Debug
cmake --build .\build\$($Compiler)x86 --config Release
}
Write-Host All done