Skip to content

Commit

Permalink
Send stderr from cmake into stdout
Browse files Browse the repository at this point in the history
This will no more break build when warnings are received from cmake.
  • Loading branch information
ForNeVeR authored and leha-bot committed Jun 28, 2019
1 parent e49340e commit bd54842
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .appveyor/build.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
$ErrorActionPreference = 'Stop'

Push-Location "$env:APPVEYOR_BUILD_FOLDER\build"

function execute-cmake {
# We have to merge the stderr and stdout here because otherwise the build will fail on any random warning
cmd /c 'cmake 2>&1' @args
if ($LASTEXITCODE -ne 0) {
throw "CMake execution error: $LASTEXITCODE"
}
}

try {
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
if (!$?) { throw 'Error running cmake' }
cmake --build . --config RelWithDebInfo
if (!$?) { throw 'Error building with cmake' }
execute-cmake '-GNinja' `
'-DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake' `
'-DCMAKE_BUILD_TYPE=RelWithDebInfo' `
..
execute-cmake --build . --config RelWithDebInfo
ctest .
if (!$?) { throw 'ctest execution error' }
} finally {
Expand Down

0 comments on commit bd54842

Please sign in to comment.