-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.ps1
34 lines (31 loc) · 859 Bytes
/
compile.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
function Ensure-BuildDirectory {
param (
[Parameter(Mandatory=$true)]
[string]$Path
)
if (Test-Path -Path $Path -PathType Container) {
Write-Host "The build directory already exists."
}
else {
try {
New-Item -Path $Path -ItemType Directory -ErrorAction Stop
Write-Host "The build directory has been created."
}
catch {
Write-Host "Failed to create the build directory: $($_.Exception.Message)"
}
}
}
Remove-Item -Recurse -Force ./build
Ensure-BuildDirectory -Path ./build
try {
# cmake ../ -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -Thost=x64
cd build
cmake ../ -G "Ninja" `
-DCMAKE_BUILD_TYPE=Debug `
-DCMAKE_CXX_COMPILER=clang++ `
-DCMAKE_C_COMPILER=clang
cmake --build . --parallel
} finally {
cd ..
}