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 766d856 commit 8cd83a9
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 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,28 +65,45 @@ 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"
}
# Download and install yasm integration
- ps: (New-Object Net.WebClient).DownloadFile('http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip', "$pwd\yasm.zip")
- ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack")
- ps: Move-Item -Force "TempYASMUnpack\*.exe" "$env:VSCOMNTOOLS\..\..\VC\bin"
- ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent)
- ps: New-Item -ItemType Directory -Force -Path "$env:VCINSTALLDIR\bin\"
- ps: Move-Item -Force "TempYASMUnpack\*.exe" "$env:VCINSTALLDIR\bin\"
- ps: (Get-Content "$pwd\TempYASMUnpack\vsyasm.props") -replace '\$\(Platform\)', 'win$(PlatformArchitecture)' | Set-Content "$pwd\TempYASMUnpack\vsyasm.props"
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0\BuildCustomizations"
# Make additional copy so its available to GitLink (which currently looks in the wrong location)
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\BuildCustomizations"
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V120\BuildCustomizations"
- ps: Copy-Item -Force "TempYASMUnpack\*.*" "$env:VCTargetsPath\BuildCustomizations"
# Additional yasm location in order to fix gitlink error
- ps: if ($env:MSVC_VER -ne 15) { Copy-Item -Force "TempYASMUnpack\*.*" "$env:VCTargetsPath\..\BuildCustomizations" }

build:
project: build.vcxproj
Expand Down

0 comments on commit 8cd83a9

Please sign in to comment.