forked from mpark/variant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
197 lines (172 loc) · 6.28 KB
/
.travis.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
language: cpp
sudo: false
branches:
only:
- master
git:
depth: 1
matrix:
include:
# ubuntu 14.04, gcc-4.9
- env: VER=4.9 STDS="11;14" TESTS="mpark"
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-4.9"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 14.04, gcc-5
- env: VER=5 STDS="11;14" TESTS="mpark"
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-5"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 14.04, gcc-6
- env: VER=6 STDS="11;14" TESTS="mpark"
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 14.04, gcc-7
- env: VER=7 STDS="11;14;17" TESTS="mpark;libc++"
compiler: gcc
os: linux
dist: trusty
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
# ubuntu 14.04, clang-3.5
- env: VER=3.5 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: precise
addons: { apt: { packages: ["clang-3.5"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.5"] } }
# ubuntu 14.04, clang-3.6
- env: VER=3.6 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: precise
addons: { apt: { packages: ["clang-3.6"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.6"] } }
# ubuntu 14.04, clang-3.7
- env: VER=3.7 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: precise
addons: { apt: { packages: ["clang-3.7"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.7"] } }
# ubuntu 14.04, clang-3.8
- env: VER=3.8 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: precise
addons: { apt: { packages: ["clang-3.8"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-precise-3.8"] } }
# ubuntu 14.04, clang-3.9
- env: VER=3.9 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: trusty
addons: { apt: { packages: ["clang-3.9"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-3.9"] } }
# ubuntu 14.04, clang-4.0
- env: VER=4.0 STDS="11;14" TESTS="mpark"
compiler: clang
os: linux
dist: trusty
addons: { apt: { packages: ["clang-4.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-4.0"] } }
# ubuntu 14.04, clang-5.0
- env: VER=5.0 STDS="11;14;17" TESTS="mpark;libc++"
compiler: clang
os: linux
dist: trusty
addons: { apt: { packages: ["clang-5.0"], sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] } }
# OS X Yosemite 10.10, Apple Clang 6
- env: STDS="11;14" TESTS="mpark"
compiler: clang
os: osx
osx_image: xcode6.4
# OS X El Capitan 10.11, Apple Clang 7
- env: STDS="11;14" TESTS="mpark"
compiler: clang
os: osx
osx_image: xcode7.3
# OS X Sierra 10.12, Apple Clang 8
- env: STDS="11;14" TESTS="mpark"
compiler: clang
os: osx
osx_image: xcode8.3
install:
# Save the name of the compiler.
- COMPILER=${CC}
# Set the correct `CC` and `CXX` environment variables.
- |
if [ -n "${VER}" ]; then
export CC="${CC}-${VER}"
export CXX="${CXX}-${VER}"
fi
- ${CXX} --version
# Directory for dependency installation.
- DEPS="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS}
# Install newer cmake.
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update
brew upgrade cmake
elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then
travis_retry wget --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
bash cmake-3.8.2-Linux-x86_64.sh --skip-license --prefix="${DEPS}"
export PATH="${DEPS}/bin:${PATH}"
fi
# Install specific version of libc++.
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${COMPILER}" = "clang" ] && [ -n "${VER}" ]; then
LLVM_VER=$(echo "$(${CXX} --version)" | grep -Po "clang version \K([0-9]\.[0-9]\.[0-9])")
if [ "${LLVM_VER}" = "5.0.1" ]; then
LLVM_VER="5.0.0"
fi
LLVM_URL="http://llvm.org/releases/${LLVM_VER}/llvm-${LLVM_VER}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VER}/libcxx-${LLVM_VER}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VER}/libcxxabi-${LLVM_VER}.src.tar.xz"
mkdir -p llvm-build llvm llvm/projects/libcxx llvm/projects/libcxxabi
travis_retry wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
pushd llvm-build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${DEPS} ../llvm
cmake --build projects/libcxx --target install -- -j 2
cmake --build projects/libcxxabi --target install -- -j 2
popd
if [ "${VER}" = "3.5" ]; then
# `cxxabi.h` isn't installed correctly for libc++-3.5.
cp llvm/projects/libcxxabi/include/cxxabi.h ${DEPS}/include/c++/v1
fi
# These flags are passed via `-DCMAKE_CXX_FLAGS` because setting them on
# `CXXFLAGS` conflicts with the include directories explicitly set by
# libc++ when it's being built for the `std::variant` tests.
COMPILE_FLAGS="-nostdinc++ -isystem ${DEPS}/include/c++/v1"
export LDFLAGS="${LDFLAGS} -L${DEPS}/lib -lc++ -lc++abi"
export LD_LIBRARY_PATH="${DEPS}/lib:${LD_LIBRARY_PATH}"
fi
script:
- STDS=(${STDS//;/ })
- BUILDS=(Debug Release)
- EXS=(ON OFF)
- mkdir build
- pushd build
- |
(
set -e
for BUILD in "${BUILDS[@]}"; do
for EX in "${EXS[@]}"; do
for STD in "${STDS[@]}"; do
(
set -x
cmake -DCMAKE_CXX_FLAGS="${COMPILE_FLAGS}" \
-DCMAKE_CXX_STANDARD="${STD}" \
-DCMAKE_BUILD_TYPE="${BUILD}" \
-DMPARK_VARIANT_EXCEPTIONS="${EX}" \
-DMPARK_VARIANT_INCLUDE_TESTS="${TESTS}" ..
)
cmake --build . -- -j 2
ctest -V
done
done
done
)
- popd
notifications:
email: false