Skip to content

Commit 2923b88

Browse files
committed
Import logging code from main build.ps1
VS2017 Build still failing on appveyor, add more detailed error messaging/logging Remove platformtarget as it doesn't appear to be a valid msbuild option
1 parent 92548a4 commit 2923b88

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

build.ps1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,26 +183,22 @@ function Msvs
183183

184184
Write-Diagnostic "Targeting $Toolchain using configuration $Configuration on platform $Platform"
185185

186-
$PlatformTarget = $null
187186
$VisualStudioVersion = $null
188187
$VXXCommonTools = $null
189188
$CmakeGenerator = $null
190189

191190
switch -Exact ($Toolchain) {
192191
'v110' {
193-
$PlatformTarget = '4.0'
194192
$VisualStudioVersion = '11.0'
195193
$VXXCommonTools = Join-Path $env:VS110COMNTOOLS '..\..\vc'
196194
$CmakeGenerator = 'Visual Studio 11'
197195
}
198196
'v120' {
199-
$PlatformTarget = '12.0'
200197
$VisualStudioVersion = '12.0'
201198
$VXXCommonTools = Join-Path $env:VS120COMNTOOLS '..\..\vc'
202199
$CmakeGenerator = 'Visual Studio 12'
203200
}
204201
'v140' {
205-
$PlatformTarget = '4.0'
206202
$VisualStudioVersion = '14.0'
207203
$VXXCommonTools = Join-Path $env:VS140COMNTOOLS '..\..\vc'
208204
$CmakeGenerator = 'Visual Studio 14'
@@ -286,7 +282,6 @@ function Msvs
286282
"/t:rebuild",
287283
"/p:VisualStudioVersion=$VisualStudioVersion",
288284
"/p:Configuration=$Configuration",
289-
"/p:PlatformTarget=$PlatformTarget",
290285
"/p:PlatformToolset=$Toolchain",
291286
"/p:Platform=$Arch",
292287
"/p:PreferredToolArchitecture=$Arch",
@@ -305,13 +300,22 @@ function Msvs
305300

306301
$StartInfo.UseShellExecute = $false
307302
$StartInfo.CreateNoWindow = $false
303+
$StartInfo.RedirectStandardError = $true
304+
$StartInfo.RedirectStandardOutput = $true
308305

309306
$Process = New-Object System.Diagnostics.Process
310307
$Process.StartInfo = $startInfo
311308
$Process.Start()
309+
310+
$stdout = $Process.StandardOutput.ReadToEnd()
311+
$stderr = $Process.StandardError.ReadToEnd()
312+
312313
$Process.WaitForExit()
313314

314-
if ($Process.ExitCode -ne 0) {
315+
if ($Process.ExitCode -ne 0)
316+
{
317+
Write-Host "stdout: $stdout"
318+
Write-Host "stderr: $stderr"
315319
Die "Build failed"
316320
}
317321

0 commit comments

Comments
 (0)