diff --git a/SMP/appveyor.yml b/SMP/appveyor.yml index 81cdbc0..94f1742 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)