1# Copyright 2016, 2017 Peter Dimov
2# Copyright (C) 2017 - 2019 James E. King III
3# Distributed under the Boost Software License, Version 1.0.
4# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
5
6#
7# Generic Appveyor build script for boostorg repositories
8# See: https://github.com/boostorg/boost-ci/
9#
10# Instructions for customizing this script for your library:
11#
12# 1. Customize the compilers and language levels you want.
13# 2. If you have more than include/, src/, test/, example/, examples/,
14#    benchmark/ or tools/ directories, set the environment variable DEPINST.
15#    For example if your build uses code in "bench/" and "fog/" directories:
16#      - DEPINST: --include bench --include fog
17# 3. Enable pull request builds in your boostorg/<library> account.
18#
19# That's it - the script will do everything else for you.
20#
21
22version: 1.0.{build}-{branch}
23
24shallow_clone: true
25
26branches:
27  only:
28    - develop
29    - master
30
31matrix:
32  # Adding MAYFAIL to any matrix job allows it to fail but the build stays green:
33  allow_failures:
34    - MAYFAIL: true
35
36environment:
37  global:
38    # see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
39    # to use the default for a given environment, comment it out; recommend you build debug and release however:
40    # on Windows it is important to exercise all the possibilities, especially shared vs static, however most
41    # libraries that care about this exercise it in their Jamfiles...
42    # B2_ADDRESS_MODEL: address-model=64,32
43    # B2_LINK: link=shared,static
44    # B2_THREADING: threading=multi,single
45    B2_VARIANT: variant=release,debug
46
47  matrix:
48    - FLAVOR: Visual Studio 2017 C++2a Strict
49      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
50      B2_ADDRESS_MODEL: address-model=64
51      B2_CXXFLAGS: cxxflags=-permissive-
52      B2_CXXSTD: latest # 2a
53      B2_TOOLSET: msvc-14.1
54
55    - FLAVOR: Visual Studio 2017 C++17
56      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
57      B2_ADDRESS_MODEL: address-model=64
58      B2_CXXSTD: 17
59      B2_TOOLSET: msvc-14.1
60
61    - FLAVOR: Visual Studio 2017 C++14 (Default)
62      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
63      B2_ADDRESS_MODEL: address-model=64,32
64      B2_TOOLSET: msvc-14.1
65
66    - FLAVOR: Visual Studio 2015 C++14 (Default)
67      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
68      B2_ADDRESS_MODEL: address-model=64,32
69      B2_TOOLSET: msvc-14.0
70
71    - FLAVOR: Visual Studio 2010, 2012, 2013
72      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
73      B2_TOOLSET: msvc-10.0,msvc-11.0,msvc-12.0
74
75    - FLAVOR: cygwin (32-bit)
76      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
77      ADDPATH: C:\cygwin\bin;
78      B2_ADDRESS_MODEL: address-model=32
79      B2_CXXSTD: 03,11
80      # https://github.com/boostorg/test/issues/144
81      B2_DEFINES: define=_POSIX_C_SOURCE=200112L
82      B2_THREADING: threadapi=pthread
83      B2_TOOLSET: gcc
84
85    - FLAVOR: cygwin (64-bit)
86      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
87      ADDPATH: C:\cygwin64\bin;
88      B2_ADDRESS_MODEL: address-model=64
89      B2_CXXSTD: 11,17
90      # https://github.com/boostorg/test/issues/144
91      B2_DEFINES: define=_POSIX_C_SOURCE=200112L define=__USE_ISOC99
92      B2_THREADING: threadapi=pthread
93      B2_TOOLSET: gcc
94
95    - FLAVOR: mingw32
96      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
97      ARCH: i686
98      B2_ADDRESS_MODEL: address-model=32
99      B2_CXXSTD: 03,11
100      SCRIPT: ci\appveyor\mingw.bat
101
102    - FLAVOR: mingw64
103      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
104      ARCH: x86_64
105      B2_ADDRESS_MODEL: address-model=64
106      B2_CXXSTD: 11,17
107      B2_DEFINES: define=__USE_ISOC99
108      SCRIPT: ci\appveyor\mingw.bat
109
110install:
111  - set SELF=%APPVEYOR_PROJECT_NAME:-=_%
112  - git clone https://github.com/boostorg/boost-ci.git C:\boost-ci
113  - xcopy /s /e /q /i C:\boost-ci\ci .\ci
114  - ci\appveyor\install.bat
115
116build: off
117
118test_script:
119  - set SELF=%APPVEYOR_PROJECT_NAME:-=_%
120  - PATH=%ADDPATH%%PATH%
121  # The definition of B2_TOOLCXX omits B2_CXXSTD= if it was not defined above
122  - IF NOT DEFINED B2_CXXSTD (SET B2_TOOLCXX=toolset=%B2_TOOLSET%) ELSE (SET B2_TOOLCXX=toolset=%B2_TOOLSET% cxxstd=%B2_CXXSTD%)
123  # Echo the complete build command to the build log
124  - IF NOT DEFINED SCRIPT                         (ECHO b2 libs/%SELF:\=/% %B2_TOOLCXX% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
125  # Now go build...
126  - IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF:\=/% %B2_TOOLCXX% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
127