From e22e1a92c933ac4b1cfedec5328104d0d44251e4 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 20 Mar 2017 18:03:09 +1100 Subject: [PATCH] project: Update appveyor to support building with VS 2017. --- SMP/appveyor.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/SMP/appveyor.yml b/SMP/appveyor.yml index 83c7d05973..81cdbc0426 100644 --- a/SMP/appveyor.yml +++ b/SMP/appveyor.yml @@ -4,7 +4,7 @@ branches: only: - master skip_non_tags: true -shallow_clone: true +clone_depth: 10 configuration: Release+ReleaseDLL @@ -13,7 +13,11 @@ platform: x86+x64 environment: matrix: - MSVC_VER: 12 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - MSVC_VER: 14 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - MSVC_VER: 15 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 install: # Install GitLink @@ -24,7 +28,7 @@ before_build: - ps: >- $script = @' - + @@ -61,18 +65,36 @@ before_build: $script = $script -replace "APPVEYOR_REPO_COMMIT", "$env:APPVEYOR_REPO_COMMIT" + $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% # Setup msvc environment for required compiler version (specified by MSVC_VER) -- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS")) -- cmd: call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" amd64 +- 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% +# Set Targets path so that gitlink works correctly +- ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent) +- ps: >- + if ($env:MSVC_VER -eq 15) { + $env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Common7\IDE\VC\VCTargets" + } else { + $env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0" + } + build: project: build.vcxproj parallel: true