Skip to content

Commit

Permalink
project: Update appveyor to build using latest available windows sdk.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jul 1, 2017
1 parent f4953ea commit 92db521
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions SMP/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @'
Expand All @@ -41,7 +66,7 @@ before_build:
</PropertyGroup>
<ItemGroup>
<ProjectToBuild Include="SMP/APPVEYOR_PROJECT_NAME.sln">
<Properties>Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\</Properties>
<Properties>Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\;WindowsTargetPlatformVersion=SDK_VER</Properties>
</ProjectToBuild>
</ItemGroup>
</Target>
Expand All @@ -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)
Expand Down

0 comments on commit 92db521

Please sign in to comment.