Commit 1545dd0d authored by Harris Hancock's avatar Harris Hancock Committed by Harris Hancock

Add initial AppVeyor support

This AppVeyor configuration will do the following:

1. Download MinGW 4.8.5, if it doesn't already have it.
2. Build and install the entire project with MinGW.
3. Build and install everything that MSVC can build, using the MinGW external
   capnp tools.
4. Build the contents of c++/samples.
5. Zip up the contents of each install directory, which will be available for
   download as artifacts.

AppVeyor will autoconfigure itself if it sees this file, so you should
just have to:

1. Log into ci.appveyor.com. You can use a GitHub account for this.
2. Select "New Project."
3. Select capnproto from the list of GitHub projects.

Push to any branch, and AppVeyor should automatically build the new
commit. If you want to build a branch that you've already uploaded, you
can change the default branch in 'Settings -> General', then start a
manual build.

I used Dr. MinGW's appveyor.yml as a template for the MinGW download and
extraction code:
https://github.com/jrfonseca/drmingw/blob/2340928f5cbc0ba718e8dd160e027af7722383c8/appveyor.yml
parent b691f8ad
# 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 the MinGW-built capnp tools.
# build the Cap'n Proto samples with VS2015 and the MinGW-built capnp tools.
# - Archive both Cap'n Proto builds in capnproto-c++-{mingw,vs2015}.zip artifacts.
version: "{build}"
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
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 INSTALL_PREFIX_MINGW=%CD%\capnproto-c++-mingw
- set INSTALL_PREFIX_VS2015=%CD%\capnproto-c++-vs2015
- cmake --version
build_script:
- echo "Building Cap'n Proto with MinGW"
- >-
cmake -Hc++ -Bbuild-mingw -G "MinGW Makefiles"
-DCMAKE_BUILD_TYPE=%BUILD_TYPE%
-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX_MINGW%
- cmake --build build-mingw --target install -- -j%NUMBER_OF_PROCESSORS%
- set PATH=%INSTALL_PREFIX_MINGW%\bin;%PATH%
- echo "Building Cap'n Proto with Visual Studio 2015"
- >-
cmake -Hc++ -Bbuild-vs2015 -G "Visual Studio 14 2015" -A x64
-DEXTERNAL_CAPNP=ON
-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX_VS2015%
- cmake --build build-vs2015 --config %BUILD_TYPE% --target install
# TODO(someday): pass `-- /maxcpucount` for a parallel build. Right now it occasionally expresses
# a filesystem-related race: capnp-capnpc++ complains that it can't create test.capnp.h.
- >-
cmake -Hc++/samples -Bbuild-samples -G "Visual Studio 14 2015" -A x64
-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX_VS2015%
-DCAPNP_EXECUTABLE=%INSTALL_PREFIX_MINGW%\bin\capnp.exe
-DCAPNPC_CXX_EXECUTABLE=%INSTALL_PREFIX_MINGW%\bin\capnpc-c++.exe
- cmake --build build-samples --config %BUILD_TYPE%
# TODO(soon): Fix tests on Windows.
#
# Tests are not currently run, because until the tests start passing normally, it's more useful for
# us to only be notified of build errors. When they start passing, uncomment the code below.
#
#test_script:
# - timeout /t 2
# # Sleep a little to prevent interleaving test output with build output.
# - cd build-msvc\src
# - ctest -V -C %BUILD_TYPE%
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment