-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.ps1
34 lines (27 loc) · 869 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 (
$Prefix="C:\clang-uml-llvm19",
$BuildType="Release"
)
# Save the original directory
$originalDirectory = Get-Location
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
try {
Set-Location util/msbuild_compile_commands_logger
dotnet build
Copy-Item bin/Debug/netstandard2.0/CompileCommandsLogger.dll CompileCommandsLogger.dll
Set-Location $originalDirectory
cmake -G "Visual Studio 17 2022" -S . -B $BuildType -DCMAKE_PREFIX_PATH="$Prefix" -Thost=x64
cmake --build $BuildType --config $BuildType -- "-logger:$PWD/util/msbuild_compile_commands_logger/CompileCommandsLogger.dll"
Set-Location $BuildType
ctest -C $BuildType --output-on-failure
}
catch {
Write-Host $Error[0]
Write-Host "Exiting script."
return
}
finally {
# Always return to the original directory
Set-Location $originalDirectory
}