1# Configuration for continuous integration service at appveyor.com
2
3version: '{build}'
4
5os: Visual Studio 2015
6
7environment:
8  matrix:
9  - Toolset: v140
10  - Toolset: v120
11  - Toolset: v110
12  - Toolset: v100
13  - Toolset: v90
14
15platform:
16  - Win32
17  - x64
18
19configuration:
20  - Release
21
22matrix:
23  exclude:
24    - Toolset: v90
25      platform: x64
26    - Toolset: v100
27      platform: x64
28
29build:
30  verbosity: minimal
31
32before_build:
33- ps: |
34    Write-Output "Configuration: $env:CONFIGURATION"
35    Write-Output "Platform: $env:PLATFORM"
36    $generator = switch ($env:TOOLSET)
37    {
38        "v140" {"Visual Studio 14 2015"}
39        "v120" {"Visual Studio 12 2013"}
40        "v110" {"Visual Studio 11 2012"}
41        "v100" {"Visual Studio 10 2010"}
42        "v90" {"Visual Studio 9 2008"}
43    }
44    if ($env:PLATFORM -eq "x64")
45    {
46        $generator = "$generator Win64"
47    }
48
49build_script:
50- ps: |
51    md _build -Force | Out-Null
52    cd _build
53
54    & cmake -G "$generator" -D CMAKE_CONFIGURATION_TYPES="Debug;Release" -D GFLAGS_BUILD_TESTING=ON -D GFLAGS_BUILD_SHARED_LIBS=ON -D GFLAGS_BUILD_STATIC_LIBS=ON ..
55    if ($LastExitCode -ne 0) {
56        throw "Exec: $ErrorMessage"
57    }
58    & cmake --build . --config $env:CONFIGURATION
59    if ($LastExitCode -ne 0) {
60        throw "Exec: $ErrorMessage"
61    }
62
63test_script:
64- ps: |
65    & ctest -C $env:CONFIGURATION --output-on-failure
66    if ($LastExitCode -ne 0) {
67        throw "Exec: $ErrorMessage"
68    }
69