cannam@147: # Cap'n Proto AppVeyor configuration cannam@147: # cannam@147: # See https://www.appveyor.com/docs/appveyor-yml/ for configuration options. cannam@147: # cannam@147: # This script configures AppVeyor to: cannam@147: # - Download and unzip MinGW-w64 4.8.5 for x86_64, the minimum gcc version Cap'n Proto advertises cannam@147: # support for. cannam@147: # - Use CMake to ... cannam@147: # build Cap'n Proto with MinGW. cannam@147: # build Cap'n Proto with VS2015 and VS2017. cannam@147: # build Cap'n Proto samples with VS2015 and VS2017. cannam@147: cannam@147: version: "{build}" cannam@147: cannam@147: branches: cannam@147: only: cannam@147: - master cannam@147: - /release-.*/ cannam@147: # Don't build non-master branches (unless they open a pull request). cannam@147: cannam@147: image: Visual Studio 2017 cannam@147: # AppVeyor build worker image (VM template). cannam@147: cannam@147: shallow_clone: true cannam@147: # Fetch repository as zip archive. cannam@147: cannam@147: cache: cannam@147: - x86_64-4.8.5-release-win32-seh-rt_v4-rev0.7z cannam@147: cannam@147: environment: cannam@147: MINGW_DIR: mingw64 cannam@147: 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: MINGW_ARCHIVE: x86_64-4.8.5-release-win32-seh-rt_v4-rev0.7z cannam@147: BUILD_TYPE: debug cannam@147: cannam@147: matrix: cannam@147: # TODO(someday): Add MSVC x64 builds, MinGW x86 build? cannam@147: cannam@147: - CMAKE_GENERATOR: Visual Studio 15 2017 cannam@147: BUILD_NAME: vs2017 cannam@147: EXTRA_BUILD_FLAGS: # /maxcpucount cannam@147: # TODO(someday): Right now /maxcpucount occasionally expresses a filesystem-related race: cannam@147: # capnp-capnpc++ complains that it can't create test.capnp.h. cannam@147: cannam@147: - CMAKE_GENERATOR: Visual Studio 14 2015 cannam@147: BUILD_NAME: vs2015 cannam@147: EXTRA_BUILD_FLAGS: # /maxcpucount cannam@147: cannam@147: - CMAKE_GENERATOR: MinGW Makefiles cannam@147: BUILD_NAME: mingw cannam@147: EXTRA_BUILD_FLAGS: -j2 cannam@147: cannam@147: install: cannam@147: - if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%" cannam@147: - 7z x -y "%MINGW_ARCHIVE%" > nul cannam@147: - ps: Get-Command sh.exe -All | Remove-Item cannam@147: # CMake refuses to generate MinGW Makefiles if sh.exe is in the PATH cannam@147: cannam@147: before_build: cannam@147: - set PATH=%CD%\%MINGW_DIR%\bin;%PATH% cannam@147: - set BUILD_DIR=build-%BUILD_NAME% cannam@147: - set INSTALL_PREFIX=%CD%\capnproto-c++-%BUILD_NAME% cannam@147: - cmake --version cannam@147: cannam@147: build_script: cannam@147: - echo "Building Cap'n Proto with %CMAKE_GENERATOR%" cannam@147: - >- cannam@147: cmake -Hc++ -B%BUILD_DIR% -G "%CMAKE_GENERATOR%" cannam@147: -DCMAKE_BUILD_TYPE=%BUILD_TYPE% cannam@147: -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX% cannam@147: - cmake --build %BUILD_DIR% --config %BUILD_TYPE% --target install -- %EXTRA_BUILD_FLAGS% cannam@147: # MinGW wants the build type at configure-time while MSVC wants the build type at build-time. We cannam@147: # can satisfy both by passing the build type to both cmake invocations. We have to suffer a cannam@147: # warning, but both generators will work. cannam@147: cannam@147: - echo "Building Cap'n Proto samples with %CMAKE_GENERATOR%" cannam@147: - >- cannam@147: cmake -Hc++/samples -B%BUILD_DIR%-samples -G "%CMAKE_GENERATOR%" cannam@147: -DCMAKE_BUILD_TYPE=%BUILD_TYPE% cannam@147: -DCMAKE_PREFIX_PATH=%INSTALL_PREFIX% cannam@147: - cmake --build %BUILD_DIR%-samples --config %BUILD_TYPE% cannam@147: cannam@147: test_script: cannam@147: - timeout /t 2 cannam@147: # Sleep a little to prevent interleaving test output with build output. cannam@147: - cd %BUILD_DIR%\src cannam@147: - ctest -V -C %BUILD_TYPE%