diff options
Diffstat (limited to '')
-rw-r--r-- | .appveyor/build.ps1 | 98 | ||||
-rw-r--r-- | appveyor.yml | 2 |
2 files changed, 98 insertions, 2 deletions
diff --git a/.appveyor/build.ps1 b/.appveyor/build.ps1 index 7c1e7eb..99caa6f 100644 --- a/.appveyor/build.ps1 +++ b/.appveyor/build.ps1 @@ -45,7 +45,7 @@ function Set-AppVeyorDefaults { $script:Configuration = $env:CONFIGURATION } -function Build-Project { +function Build-ProjectUserMode { param( [Parameter(Mandatory=$true)] [string] $ProjectDir, @@ -66,6 +66,102 @@ function Build-Project { Invoke-Exe { cmake.exe --build . --config $Configuration -- /m } } +function Get-DriverConfiguration { + param( + [Parameter(Mandatory=$true)] + [string] $Configuration + ) + + return "Win7 $Configuration" +} + +function Get-DriverBuildDir { + param( + [Parameter(Mandatory=$true)] + [string] $ProjectDir, + [Parameter(Mandatory=$true)] + [string] $DriverSpec + ) + + return "$ProjectDir\km\build\wdk8.1update\$DriverSpec" +} + +function Get-DriverSolutionPath { + param( + [Parameter(Mandatory=$true)] + [string] $ProjectDir, + [Parameter(Mandatory=$true)] + [string] $DriverSpec + ) + + $build_dir = Get-DriverBuildDir -ProjectDir $ProjectDir -DriverSpec $DriverSpec + $driver_name = Split-Path -Path $build_dir -Leaf -Resolve + return "$build_dir\$driver_name.vs12.sln" +} + +function Build-Driver { + param( + [Parameter(Mandatory=$true)] + [string] $ProjectDir, + [Parameter(Mandatory=$true)] + [string] $DriverSpec, + [Parameter(Mandatory=$true)] + [string] $Platform, + [Parameter(Mandatory=$true)] + [string] $Configuration + ) + + $build_dir = Get-DriverBuildDir -ProjectDir $ProjectDir -DriverSpec $DriverSpec + $solution_path = Get-DriverSolutionPath -ProjectDir $ProjectDir -DriverSpec $DriverSpec + + $Configuration = Get-DriverConfiguration -Configuration $Configuration + $msbuild_params = "/p:Configuration=$Configuration;Platform=$Platform" + + cd $build_dir + Invoke-Exe { msbuild.exe $msbuild_params $solution_path } +} + +function Build-ProjectKernelMode { + param( + [Parameter(Mandatory=$true)] + [string] $ProjectDir, + [Parameter(Mandatory=$true)] + [string] $Platform, + [Parameter(Mandatory=$true)] + [string] $Configuration + ) + + Build-Driver -ProjectDir $ProjectDir -Platform $Platform -Configuration $Configuration -DriverSpec 'minimal' + Build-Driver -ProjectDir $ProjectDir -Platform $Platform -Configuration $Configuration -DriverSpec 'simple' + Build-Driver -ProjectDir $ProjectDir -Platform $Platform -Configuration $Configuration -DriverSpec 'special\nt_namespace' +} + +function Build-Project { + param( + [Parameter(Mandatory=$true)] + [string] $ProjectDir, + [Parameter(Mandatory=$true)] + [string] $BuildDir, + [Parameter(Mandatory=$true)] + [string] $Generator, + [Parameter(Mandatory=$true)] + [string] $Platform, + [Parameter(Mandatory=$true)] + [string] $Configuration + ) + + Build-ProjectUserMode ` + -ProjectDir $ProjectDir ` + -BuildDir $BuildDir ` + -Generator $Generator ` + -Platform $Platform ` + -Configuration $Configuration + Build-ProjectKernelMode ` + -ProjectDir $ProjectDir ` + -Platform $Platform ` + -Configuration $Configuration +} + function Build-ProjectAppVeyor { if (Test-AppVeyor) { Set-AppVeyorDefaults diff --git a/appveyor.yml b/appveyor.yml index 2bea0dd..20ee0ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: '{build}' -image: Visual Studio 2015 +image: Visual Studio 2013 branches: only: |