Check for MSBuild failure in PS build script

This commit is contained in:
NicknineTheEagle 2022-05-01 19:08:08 +03:00
parent b081312831
commit fc0a5fc993

View File

@ -135,7 +135,7 @@ function CallMsbuild
$msbuild = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
if(!($msbuild -and $(Test-Path $msbuild))) {
Write-Error "Unable to find MSBuild. Is Visual Studio installed?"
throw "Unable to find MSBuild. Is Visual Studio installed?"
}
# main build (pass config separate and not as a single string)
@ -145,6 +145,10 @@ function CallMsbuild
else {
& $msbuild $solution $config $platform $toolset $sdk $target /m > "msvc-build.log"
}
if ($LASTEXITCODE -ne 0) {
throw "MSBuild failed with error code $LASTEXITCODE"
}
}
function Build
@ -219,6 +223,7 @@ function MakePackage
if(!(Test-Path "$configuration/test.exe")) {
Write-Error "Unable to find binaries, check for compilation errors"
return
}
Compress-Archive $cliFiles $configuration/vgmstream-win.zip -Force