From 6608e037d93e902852f2956996a929cc8ac4ef97 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sun, 2 Jul 2017 04:52:00 +1000 Subject: [PATCH] project: Update appveyor to build using latest available windows sdk. --- SMP/appveyor.yml | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/SMP/appveyor.yml b/SMP/appveyor.yml index 81cdbc042..94f1742dc 100644 --- a/SMP/appveyor.yml +++ b/SMP/appveyor.yml @@ -24,6 +24,31 @@ install: - cmd: choco install gitlink before_build: +# Backup platform so it is not affected by vcvars +- cmd: SET PLATFORMBACK=%PLATFORM% + +# Setup msvc environment for required compiler version (specified by MSVC_VER) +- ps: >- + if ($env:MSVC_VER -eq 15) { + $env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" + } else { + $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS")) + $env:VCVARS="%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" + } + +- cmd: call "%VCVARS%" amd64 + +# Detect latest available windows sdk version +- ps: >- + if ($env:MSVC_VER -eq 12) { + $env:WindowsSDKVersion=8.1 + } else { + $env:WindowsSDKVersion=$env:WindowsSDKVersion.TrimEnd('\') + } + +# Reset platform +- cmd: SET PLATFORM=%PLATFORMBACK% + # Create build project to compile all configurations and platforms at once - ps: >- $script = @' @@ -41,7 +66,7 @@ before_build: - Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\ + Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\;WindowsTargetPlatformVersion=SDK_VER @@ -52,7 +77,7 @@ before_build: %(PlatformList.Identity) - + @@ -67,24 +92,9 @@ before_build: $script = $script -replace "APPVEYOR_MSVC_VER", "$env:MSVC_VER" - $script | Out-File build.vcxproj - -# Backup platform so it is not affected by vcvars -- cmd: SET PLATFORMBACK=%PLATFORM% + $script = $script -replace "SDK_VER", "$env:WindowsSDKVersion" -# Setup msvc environment for required compiler version (specified by MSVC_VER) -- ps: >- - if ($env:MSVC_VER -eq 15) { - $env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" - } else { - $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS")) - $env:VCVARS="%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" - } - -- cmd: call "%VCVARS%" amd64 - -# Reset platform -- cmd: SET PLATFORM=%PLATFORMBACK% + $script | Out-File build.vcxproj # Set Targets path so that gitlink works correctly - ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent)