• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1shallow_clone: true
2
3platform:
4  - x86
5  - x64
6
7configuration:
8  - Debug
9  - Release
10
11image:
12  - Visual Studio 2015
13  - Visual Studio 2017
14
15environment:
16  NINJA_TAG: v1.8.2
17  NINJA_SHA512: 9B9CE248240665FCD6404B989F3B3C27ED9682838225E6DC9B67B551774F251E4FF8A207504F941E7C811E7A8BE1945E7BCB94472A335EF15E23A0200A32E6D5
18  NINJA_PATH: C:\Tools\ninja\ninja-%NINJA_TAG%
19  VCVAR2015: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
20  VCVAR2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
21  matrix:
22    - GSL_CXX_STANDARD: 14
23      USE_TOOLSET: MSVC
24      USE_GENERATOR: MSBuild
25    - GSL_CXX_STANDARD: 17
26      USE_TOOLSET: MSVC
27      USE_GENERATOR: MSBuild
28    - GSL_CXX_STANDARD: 14
29      USE_TOOLSET: LLVM
30      USE_GENERATOR: Ninja
31    - GSL_CXX_STANDARD: 17
32      USE_TOOLSET: LLVM
33      USE_GENERATOR: Ninja
34
35matrix:
36    exclude:
37    - image: Visual Studio 2015
38      GSL_CXX_STANDARD: 17
39    - image: Visual Studio 2015
40      USE_TOOLSET: LLVM
41      USE_GENERATOR: MSBuild
42
43cache:
44  - C:\cmake-3.8.0-win32-x86
45  - C:\Tools\ninja
46
47install:
48  - ps: |
49      if (![IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
50        Start-FileDownload `
51          "https://github.com/ninja-build/ninja/releases/download/$env:NINJA_TAG/ninja-win.zip"
52        $hash = (Get-FileHash ninja-win.zip -Algorithm SHA512).Hash
53        if ($env:NINJA_SHA512 -eq $hash) {
54          7z e -y -bso0 ninja-win.zip -o"$env:NINJA_PATH"
55        } else { Write-Warning "Ninja download hash changed!"; Write-Output "$hash" }
56      }
57      if ([IO.File]::Exists("$env:NINJA_PATH\ninja.exe")) {
58        $env:PATH = "$env:NINJA_PATH;$env:PATH"
59      } else { Write-Warning "Failed to find ninja.exe in expected location." }
60      if ($env:USE_TOOLSET -ne "LLVM") {
61        if (![IO.File]::Exists("C:\cmake-3.8.0-win32-x86\bin\cmake.exe")) {
62          Start-FileDownload 'https://cmake.org/files/v3.8/cmake-3.8.0-win32-x86.zip'
63          7z x -y -bso0 cmake-3.8.0-win32-x86.zip -oC:\
64        }
65        $env:PATH="C:\cmake-3.8.0-win32-x86\bin;$env:PATH"
66      }
67
68before_build:
69  - ps: |
70      if ("$env:USE_GENERATOR" -eq "Ninja") {
71        $GeneratorFlags = '-k 10'
72        $Architecture = $env:PLATFORM
73        if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
74          $env:VCVARSALL = "`"$env:VCVAR2015`" $Architecture"
75        } else {
76          $env:VCVARSALL = "`"$env:VCVAR2017`" $Architecture"
77        }
78        $env:CMakeGenFlags = "-G Ninja -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
79      } else {
80        $GeneratorFlags = '/m /v:minimal'
81        if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") {
82          $Generator = 'Visual Studio 14 2015'
83        } else {
84          $Generator = 'Visual Studio 15 2017'
85        }
86        if ("$env:PLATFORM" -eq "x86") {
87            $Architecture = "Win32"
88        } else {
89            $Architecture = "x64"
90        }
91        if ("$env:USE_TOOLSET" -eq "LLVM") {
92          $env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -T llvm -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
93        } else {
94          $env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD"
95        }
96      }
97      if ("$env:USE_TOOLSET" -eq "LLVM") {
98        $env:CC  = "clang-cl"
99        $env:CXX = "clang-cl"
100        if ("$env:PLATFORM" -eq "x86") {
101          $env:CFLAGS   = "-m32";
102          $env:CXXFLAGS = "-m32";
103        } else {
104          $env:CFLAGS   = "-m64";
105          $env:CXXFLAGS = "-m64";
106        }
107      }
108      $env:CMakeBuildFlags = "--config $env:CONFIGURATION -- $GeneratorFlags"
109  - mkdir build
110  - cd build
111  - if %USE_GENERATOR%==Ninja (call %VCVARSALL%)
112  - echo %CMakeGenFlags%
113  - cmake .. %CMakeGenFlags%
114
115build_script:
116  - echo %CMakeBuildFlags%
117  - cmake --build . %CMakeBuildFlags%
118
119test_script:
120  - ctest -j2
121
122deploy: off
123