1
0
Fork 0

fixed more windows weirdness

This commit is contained in:
Christian Kühnel 2019-12-16 10:09:47 +00:00
parent 09327f289e
commit 404fcf9138
3 changed files with 11 additions and 3 deletions

View file

@ -42,7 +42,7 @@ function Invoke-Call {
[scriptblock]$ScriptBlock,
[string]$ErrorAction = "Stop"
)
& @ScriptBlock | ForEach-Object { "$_" }
& @ScriptBlock *>&1 | ForEach-Object { "$_" }
if (($lastexitcode -ne 0) -and $ErrorAction -eq "Stop") {
Write-Error "Command $ScriptBlock exited with $lastexitcode."
exit $lastexitcode

View file

@ -14,19 +14,22 @@
. ${PSScriptRoot}\common.ps1
# Delete and re-create build folder
Remove-Item build -Recurse -ErrorAction Ignore
New-Item -ItemType Directory -Force -Path build | Out-Null
Push-Location build
# load Vistual Studio environment variables
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
# call CMake
Invoke-Call -ScriptBlock {
cmake ..\llvm -G Ninja -DCMAKE_BUILD_TYPE=Release `
-D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" `
-D LLVM_ENABLE_ASSERTIONS=ON `
-DLLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml" `
-D LLVM_ENABLE_DIA_SDK=OFF
} -ErrorAction Stop
}
# LLVM_ENABLE_DIA_SDK=OFF is a workaround to make the tests pass.
# see https://bugs.llvm.org/show_bug.cgi?id=44151

View file

@ -18,8 +18,13 @@ param(
. ${PSScriptRoot}\common.ps1
# cd into build folder
Push-Location build
Invoke-Call -ScriptBlock {ninja $target} -ErrorAction Stop
# load Visual Studio environment variables
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
# call ninja
Invoke-Call -ScriptBlock {ninja $target}
Pop-Location