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