Skip to content

Commit

Permalink
project: Update appveyor to support building with VS 2017.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Mar 20, 2017
1 parent cf6fd9f commit e67a335
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions SMP/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ branches:
only:
- master
skip_non_tags: true
shallow_clone: true
clone_depth: 10

configuration: Release+ReleaseDLL

Expand All @@ -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
Expand All @@ -24,7 +28,7 @@ before_build:
- ps: >-
$script = @'
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GitLink" ToolsVersion="4.0">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GitLink" ToolsVersion="APPVEYOR_MSVC_VER.0">
<ItemGroup>
<ConfigurationList Condition="'@(ConfigurationList)' == '' and $(Configuration) != ''" Include="$(Configuration.Split('+'))" />
<ConfigurationList Condition="'@(ConfigurationList)' == ''" Include="Release" />
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e67a335

Please sign in to comment.