@@ -4,29 +4,51 @@ branches:
44 only :
55 - master
66skip_non_tags : true
7- configuration : Release+ReleaseDLL
87shallow_clone : true
98
9+ configuration : Release+ReleaseDLL
10+
11+ platform : x86+x64
12+
1013environment :
1114 matrix :
12- - MSVC_VER : 14
1315 - MSVC_VER : 12
14-
16+ - MSVC_VER : 14
17+
18+ install :
19+ # Install GitLink
20+ - cmd : choco install gitlink
21+
1522before_build :
23+ # Create build project to compile all configurations and platforms at once
1624- ps : >-
1725 $script = @'
1826
19- <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build " ToolsVersion="4.0">
27+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GitLink " ToolsVersion="4.0">
2028 <ItemGroup>
2129 <ConfigurationList Condition="'@(ConfigurationList)' == '' and $(Configuration) != ''" Include="$(Configuration.Split('+'))" />
2230 <ConfigurationList Condition="'@(ConfigurationList)' == ''" Include="Release" />
23- <PlatformList Condition="'@(PlatformList)' == ''" Include="x64;Win32" />
31+ <PlatformList Condition="'@(PlatformList)' == '' and $(Platform) != ''" Include="$(Platform.Split('+'))" />
32+ <PlatformList Condition="'@(PlatformList)' == ''" Include="x64;x86" />
2433 </ItemGroup>
25- <Target Name="Build" Outputs="%(PlatformList.Identity)">
34+ <Target Name="List" Outputs="%(PlatformList.Identity)">
35+ <PropertyGroup>
36+ <CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform>
37+ </PropertyGroup>
38+ <ItemGroup>
39+ <ProjectToBuild Include="SMP/APPVEYOR_PROJECT_NAME.sln">
40+ <Properties>Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\</Properties>
41+ </ProjectToBuild>
42+ </ItemGroup>
43+ </Target>
44+ <Target Name="Build" DependsOnTargets="List">
45+ <MSBuild Projects="@(ProjectToBuild)" BuildInParallel="true" />
46+ </Target>
47+ <Target Name="GitLink" DependsOnTargets="Build" Outputs="%(PlatformList.Identity)">
2648 <PropertyGroup>
2749 <CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform>
2850 </PropertyGroup>
29- <MSBuild Projects=" SMP/APPVEYOR_PROJECT_NAME.sln" Properties="Configuration= %(ConfigurationList.Identity);Platform= $(CurrentPlatform);OutDir= $(MSBuildThisFileDirectory)build_out\;" />
51+ <Exec Command="GitLink . -f SMP/APPVEYOR_PROJECT_NAME.sln -c %(ConfigurationList.Identity) -p $(CurrentPlatform) -d $(MSBuildThisFileDirectory)build_out\lib\$(CurrentPlatform) -u https://github.com/APPVEYOR_REPO_NAME.git -s APPVEYOR_REPO_COMMIT" />
3052 </Target>
3153 </Project>
3254
@@ -35,16 +57,33 @@ before_build:
3557
3658 $script = $script -replace "APPVEYOR_PROJECT_NAME", "$env:APPVEYOR_PROJECT_NAME"
3759
60+ $script = $script -replace "APPVEYOR_REPO_NAME", "$env:APPVEYOR_REPO_NAME"
61+
62+ $script = $script -replace "APPVEYOR_REPO_COMMIT", "$env:APPVEYOR_REPO_COMMIT"
63+
3864 $script | Out-File build.vcxproj
65+
66+ # Backup platform so it is not affected by vcvars
67+ - cmd : SET PLATFORMBACK=%PLATFORM%
68+
69+ # Setup msvc environment for required compiler version (specified by MSVC_VER)
3970- ps : $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS"))
4071- cmd : call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
72+
73+ # Reset platform
74+ - cmd : SET PLATFORM=%PLATFORMBACK%
75+
76+ # Download and install yasm integration
4177- ps : (New-Object Net.WebClient).DownloadFile('http://www.tortall.net/projects/yasm/releases/vsyasm-1.3.0-win64.zip', "$pwd\yasm.zip")
42- - ps : Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack");
78+ - ps : Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack")
4379- ps : Move-Item -Force "TempYASMUnpack\*.exe" "$env:VSCOMNTOOLS\..\..\VC\bin"
4480- ps : $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent)
4581- ps : (Get-Content "$pwd\TempYASMUnpack\vsyasm.props") -replace '\$\(Platform\)', 'win$(PlatformArchitecture)' | Set-Content "$pwd\TempYASMUnpack\vsyasm.props"
46- - ps : Move-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0\BuildCustomizations"
47-
82+ - ps : Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0\BuildCustomizations"
83+ # Make additional copy so its available to GitLink (which currently looks in the wrong location)
84+ - ps : Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\BuildCustomizations"
85+ - ps : Copy-Item -Force "TempYASMUnpack\*.*" "$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V120\BuildCustomizations"
86+
4887build :
4988 project : build.vcxproj
5089 parallel : true
0 commit comments