forked from capnproto/capnproto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
87 lines (72 loc) · 2.98 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Cap'n Proto AppVeyor configuration
#
# See https://www.appveyor.com/docs/appveyor-yml/ for configuration options.
#
# This script configures AppVeyor to:
# - Download and unzip MinGW-w64 4.8.5 for x86_64, the minimum gcc version Cap'n Proto advertises
# support for.
# - Use CMake to ...
# build Cap'n Proto with MinGW.
# build Cap'n Proto with VS2015 and VS2017.
# build Cap'n Proto samples with VS2015 and VS2017.
version: "{build}"
branches:
only:
- master
- /release-.*/
# Don't build non-master branches (unless they open a pull request).
image: Visual Studio 2017
# AppVeyor build worker image (VM template).
shallow_clone: true
# Fetch repository as zip archive.
cache:
- x86_64-4.8.5-release-win32-seh-rt_v4-rev0.7z
environment:
MINGW_DIR: mingw64
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.8.5/threads-win32/seh/x86_64-4.8.5-release-win32-seh-rt_v4-rev0.7z/download
MINGW_ARCHIVE: x86_64-4.8.5-release-win32-seh-rt_v4-rev0.7z
BUILD_TYPE: debug
matrix:
# TODO(someday): Add MSVC x64 builds, MinGW x86 build?
- CMAKE_GENERATOR: Visual Studio 15 2017
BUILD_NAME: vs2017
EXTRA_BUILD_FLAGS: # /maxcpucount
# TODO(someday): Right now /maxcpucount occasionally expresses a filesystem-related race:
# capnp-capnpc++ complains that it can't create test.capnp.h.
- CMAKE_GENERATOR: Visual Studio 14 2015
BUILD_NAME: vs2015
EXTRA_BUILD_FLAGS: # /maxcpucount
- CMAKE_GENERATOR: MinGW Makefiles
BUILD_NAME: mingw
EXTRA_BUILD_FLAGS: -j2
install:
- if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
- 7z x -y "%MINGW_ARCHIVE%" > nul
- ps: Get-Command sh.exe -All | Remove-Item
# CMake refuses to generate MinGW Makefiles if sh.exe is in the PATH
before_build:
- set PATH=%CD%\%MINGW_DIR%\bin;%PATH%
- set BUILD_DIR=build-%BUILD_NAME%
- set INSTALL_PREFIX=%CD%\capnproto-c++-%BUILD_NAME%
- cmake --version
build_script:
- echo "Building Cap'n Proto with %CMAKE_GENERATOR%"
- >-
cmake -Hc++ -B%BUILD_DIR% -G "%CMAKE_GENERATOR%"
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%
- cmake --build %BUILD_DIR% --config %BUILD_TYPE% --target install -- %EXTRA_BUILD_FLAGS%
# MinGW wants the build type at configure-time while MSVC wants the build type at build-time. We
# can satisfy both by passing the build type to both cmake invocations. We have to suffer a
# warning, but both generators will work.
- echo "Building Cap'n Proto samples with %CMAKE_GENERATOR%"
- >-
cmake -Hc++/samples -B%BUILD_DIR%-samples -G "%CMAKE_GENERATOR%"
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX%
- cmake --build %BUILD_DIR%-samples --config %BUILD_TYPE%
test_script:
- timeout /t 2
# Sleep a little to prevent interleaving test output with build output.
- cd %BUILD_DIR%\src
- ctest -V -C %BUILD_TYPE%