-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
102 lines (85 loc) · 4.42 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
# From: https://github.com/boostorg/hana/blob/master/.travis.yml
# and: https://github.com/ldionne/dyno/blob/master/.travis.yml
language: cpp
dist: trusty
sudo: false
cache:
directories:
- ${TRAVIS_BUILD_DIR}/deps/boost-1.66.0 # Keep this in sync with BOOST_VERSION
- ${TRAVIS_BUILD_DIR}/dependencies
matrix:
include:
- env: COMPILER=g++-6
addons: { apt: { packages: ["g++-6", "libzmq3-dev"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=g++-7
addons: { apt: { packages: ["g++-7", "libzmq3-dev"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=clang++-3.8
addons: { apt: { packages: ["clang-3.8", "libzmq3-dev"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=clang++-3.9
addons: { apt: { packages: ["clang-3.9", "libzmq3-dev"], sources: ["ubuntu-toolchain-r-test"] } }
- env: COMPILER=clang++-4.0
addons: { apt: { packages: ["clang-4.0", "libzmq3-dev"], sources: ["llvm-toolchain-trusty-4.0"] } }
- env: COMPILER=clang++-5.0
addons: { apt: { packages: ["clang-5.0", "libzmq3-dev"], sources: ["llvm-toolchain-trusty-5.0"] } }
install:
# Set the ${CXX} variable properly
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
- ${CXX} --version
# Dependencies required by the CI are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
# Install a recent CMake
- CMAKE_VERSION=3.10.0
- CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
- (mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake)
- export PATH=${DEPS_DIR}/cmake/bin:${PATH}
- cmake --version
# Install libc++ and libc++abi if needed
- |
if [[ "${CXX%%+*}" == "clang" ]]; then
if [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1";
elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1";
elif [[ "${CXX}" == "clang++-4.0" ]]; then LLVM_VERSION="4.0.0";
elif [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.0";
fi
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
mkdir -p llvm llvm/build 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
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install)
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-isystem ${DEPS_DIR}/llvm/install/include/c++/v1"
export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib"
fi
# Install Boost headers
- BOOST_VERSION=1.66.0 # Keep this in sync with the cached directory
- BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}
- |
if [[ -z "$(ls -A ${BOOST_DIR})" ]]; then
BOOST_URL="http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION//\./_}.tar.gz"
mkdir -p ${BOOST_DIR}
{ travis_retry wget -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
fi
before_script:
- cd "${TRAVIS_BUILD_DIR}"
- |
if [[ "${CXX%%+*}" == "clang" ]]; then
(cd ${BOOST_DIR} && ./bootstrap.sh --with-libraries=program_options,filesystem && ./b2 toolset=clang cxxflags="-std=c++1y ${CXXFLAGS}" include="${BOOST_DIR}" linkflags="${LDFLAGS}" --with-program_options --with-filesystem)
else
(cd ${BOOST_DIR} && ./bootstrap.sh --with-libraries=program_options,filesystem && ./b2 cxxflags=-std=c++1y --with-program_options --with-filesystem)
fi
- (cd dependencies && ./install.sh)
- (mkdir build && cd build && cmake .. -DBOOST_ROOT="${BOOST_DIR}" -DCMAKE_PREFIX_PATH="${TRAVIS_BUILD_DIR}/dependencies/install")
script:
- cd ${TRAVIS_BUILD_DIR}/build
- cmake --build . -- -j2
- ctest -VV .
notifications:
email:
on_success: never
on_failure: always