forked from viboes/std-make
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
324 lines (299 loc) · 11.4 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# Copyright Louis Dionne 2013-2016
# Copyright Gonzalo BG 2014-2017
# Copyright Julian Becker 2015
# Copyright Manu Sánchez 2015
# Copyright Casey Carter 2015-2017
# Copyright Eric Niebler 2015-2016
# Copyright Paul Fultz II 2015-2016
# Copyright Jakub Szuppe 2016.
# Copyright Vicente J. Botet Escriba 2017.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)
# Adapted from various sources, including:
# - Eric Nibbler's Range-v3: https://github.com/ericniebler/range-v3
language: cpp
script: cmake
env:
global:
- DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
- BOOST_URL="http://sourceforge.net/projects/boost/files/boost/1.65.1/boost_1_65_1.tar.gz"
- BOOST_VERSION="1_65_1"
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/cmake
matrix:
include:
- env: BUILD_TYPE=Release CPP=11 ASAN=Off SYSTEM_LIBCXX=On BOOST=On
os: osx
compiler: clang
# ASAN disabled for clang < 3.8 builds per resolution of
# https://llvm.org/bugs/show_bug.cgi?id=22757
# clang 3.6 C++11/14 Release libc++
# - env: CLANG_VERSION=3.6 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=On BOOST=On
# os: linux
# addons: &clang36
# apt:
# packages:
# - clang-3.6
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.6
#
# - env: CLANG_VERSION=3.6 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=On HEADERS=On BOOST=On
# os: linux
# addons: *clang36
# clang 3.7 C++11/14 Release libc++
# - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: &clang37
# apt:
# packages:
# - util-linux
# - clang-3.7
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.7
#
# - env: CLANG_VERSION=3.7 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=On HEADERS=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang37
# clang 3.8 C++11/14 Release ASAN libc++
# - env: CLANG_VERSION=3.8 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: &clang38
# apt:
# packages:
# - util-linux
# - clang-3.8
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.8
#
# - env: CLANG_VERSION=3.8 BUILD_TYPE=Release CPP=14 ASAN=On LIBCXX=On HEADERS=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang38
# clang 3.9 C++11/14 Release ASAN libc++
# - env: CLANG_VERSION=3.9 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: &clang39
# apt:
# packages:
# - util-linux
# - clang-3.9
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.9
#
# - env: CLANG_VERSION=3.9 BUILD_TYPE=Release CPP=14 ASAN=On LIBCXX=On HEADERS=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang39
# clang 4.0 C++11/14 Release ASAN libc++
# - env: CLANG_VERSION=4.0 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: &clang40
# apt:
# packages:
# - util-linux
# - clang-4.0
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-4.0
#
#
# - env: CLANG_VERSION=4.0 BUILD_TYPE=Release CPP=14 ASAN=On LIBCXX=On HEADERS=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang40
# clang 5 C++11/14/1z Debug/Release-ASAN libc++, 11 Debug libstdc++
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: &clang5
# apt:
# packages:
# - util-linux
# - clang-5.0
# - g++-6
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Release CPP=11 ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Debug CPP=14 ASAN=Off LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Release CPP=14 ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Debug CPP=1z ASAN=Off LIBCXX=On HEADERS=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Release CPP=1z ASAN=On LIBCXX=On CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
#
# - env: CLANG_VERSION=5.0 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off CLANG_MODULES=Off BOOST=On
# os: linux
# addons: *clang5
# # gcc-4.8 C++11 Debug/Release
# - env: GCC_VERSION=4.8 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=Off HEADERS=On BOOST=On
# os: linux
# addons: &gcc48
# apt:
# packages:
# - g++-4.8
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
# - env: GCC_VERSION=4.8 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: *gcc48
# gcc-4.9 C++11/C++14 Release
# - env: GCC_VERSION=4.9 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: &gcc49
# apt:
# packages:
# - g++-4.9
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
#
# - env: GCC_VERSION=4.9 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=Off HEADERS=On BOOST=On
# os: linux
# addons: *gcc49
# gcc-5 C++11/C++14 Release
# - env: GCC_VERSION=5 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: &gcc5
# apt:
# packages:
# - g++-5
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
#
# - env: GCC_VERSION=5 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=Off HEADERS=On BOOST=On
# os: linux
# addons: *gcc5
# gcc-6 C++11/14/1z Debug/Release
# - env: GCC_VERSION=6 BUILD_TYPE=Debug CPP=11 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: &gcc6
# apt:
# packages:
# - g++-6
# - valgrind
# sources:
# - ubuntu-toolchain-r-test
#
# - env: GCC_VERSION=6 BUILD_TYPE=Release CPP=11 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: *gcc6
#
# - env: GCC_VERSION=6 BUILD_TYPE=Debug CPP=14 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: *gcc6
#
# - env: GCC_VERSION=6 BUILD_TYPE=Release CPP=14 ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: *gcc6
#
# - env: GCC_VERSION=6 BUILD_TYPE=Debug CPP=1z ASAN=Off LIBCXX=Off HEADERS=On BOOST=On
# os: linux
# addons: *gcc6
#
# - env: GCC_VERSION=6 BUILD_TYPE=Release CPP=1z ASAN=Off LIBCXX=Off BOOST=On
# os: linux
# addons: *gcc6
# Install dependencies
before_install:
- export CHECKOUT_PATH=`pwd`;
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update
brew install valgrind
brew install gnu-sed --with-default-names
brew install gnu-which --with-default-names
fi
- |
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
if [ -z "$(ls -A ${TRAVIS_BUILD_DIR}/deps/cmake/bin)" ]; then
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
mkdir -p ${TRAVIS_BUILD_DIR}/deps/cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C ${TRAVIS_BUILD_DIR}/deps/cmake
fi
export PATH="${TRAVIS_BUILD_DIR}/deps/cmake/bin:${PATH}"
else
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
fi
- if [ -n "$GCC_VERSION" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
- if [ -n "$CLANG_VERSION" ]; then export CXX="clang++-${CLANG_VERSION}" CC="clang-${CLANG_VERSION}"; fi
- which $CXX
- which $CC
- which valgrind
- $CXX --version
- if [ "$ASAN" == "On" ]; then export SANITIZER=Address; fi
- if [ -n "$CLANG_VERSION" ]; then sudo PATH="${PATH}" CXX="$CXX" CC="$CC" ./install_libcxx.sh; fi
# Download and install Boost
# Adapted from Boost.Compute (under the Boost License)
# Copyright Jakub Szuppe 2016.
- |
if [[ ${TRAVIS_OS_NAME} == "linux" && ${BOOST} == "On" ]]; then
if [ ! -f "${DEPS_DIR}/boost/${BOOST_VERSION}_cached" ]; then
# create dirs for source and install
mkdir -p ${DEPS_DIR}/boost${BOOST_VERSION}
mkdir -p ${DEPS_DIR}/boost
rm -rf ${DEPS_DIR}/boost/*
# download
travis_retry wget --no-check-certificate --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/boost${BOOST_VERSION}
pushd ${DEPS_DIR}/boost${BOOST_VERSION}
# configure and install
./bootstrap.sh --prefix=${DEPS_DIR}/boost/
#--with-libraries=chrono,date_time,system
./b2 toolset=clang cxxflags="-stdlib=libc++ -nostdinc++ -cxx-isystem /usr/include/c++/v1/" linkflags="-stdlib=libc++"
./b2 -d0 install
popd
touch ${DEPS_DIR}/boost/${BOOST_VERSION}_cached
else
echo 'Using cached Boost ${BOOST_VERSION} libraries.'
fi
fi
install:
- cd $CHECKOUT_PATH
# Workaround for valgrind bug: https://bugs.kde.org/show_bug.cgi?id=326469.
# It is fixed in valgrind 3.10 so this won't be necessary if someone
# replaces the current valgrind (3.7) with valgrind-3.10
- if [ "$BUILD_TYPE" == "Release" ] && [ "$ASAN" == "Off" ]; then sed -i 's/march=native/msse4.2/' CMakeLists.txt; fi
- mkdir -p build
- cd build
- if [ -n "$CLANG_VERSION" -a "$ASAN" == "On" ]; then CXX_FLAGS="${CXX_FLAGS} -fsanitize=address,undefined,integer -fno-omit-frame-pointer -fno-sanitize=unsigned-integer-overflow"; fi
- if [ -n "$GCC_VERSION" -a "$ASAN" == "On" ]; then CXX_FLAGS="${CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer"; fi
- if [ "$GCC_VERSION" == "5" ]; then CXX_FLAGS="${CXX_FLAGS}"; fi
- if [ -n "$CLANG_VERSION" ]; then CXX_FLAGS="${CXX_FLAGS} -D__extern_always_inline=inline"; fi
- if [ "$LIBCXX" == "On" ]; then CXX_FLAGS="${CXX_FLAGS} -stdlib=libc++ -nostdinc++ -cxx-isystem /usr/include/c++/v1/ -Wno-unused-command-line-argument"; fi
- if [ "$HEADERS" == "On" ]; then HEADER_CHECK=1; else HEADER_CHECK=0; fi
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${CXX_LINKER_FLAGS}"
- if [ "$BOOST" == "On" ]; then cmake .. -DBOOST_ROOT=${DEPS_DIR}/boost; fi
- if [ "$CLANG_MODULES" == "On" ] && [ "$LIBCXX" == "On" ]; then cmake ..; fi
- make -j2 VERBOSE=1
script:
# Only enable valgrind for non-ASAN Release builds (keep this in sync with line 309)
- if [ "$BUILD_TYPE" == "Release" ] && [ "$ASAN" == "Off" ]; then CTEST_FLAGS="-D ExperimentalMemCheck"; fi
- ctest -j2 -VV ${CTEST_FLAGS}
notifications:
email: false