-
Notifications
You must be signed in to change notification settings - Fork 84
/
.travis.yml
94 lines (77 loc) · 3.08 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
language: cpp
os: linux
dist: trusty
sudo: false
env:
global:
- DEPS_DIR="${HOME}/deps"
- LOCAL_USR_DIR="${HOME}/local"
- CMAKE_VERSION=default
- BOOST_VERSION=1.67.0
cache:
ccache: false
directories:
- ${DEPS_DIR}
matrix:
include:
- name: "Debug"
env: CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Debug' MATRIX_EVAL="export CC='gcc-7' CXX='g++-7'"
addons: { apt: { packages: [cmake, cmake-data, 'g++-7'], sources: [ubuntu-toolchain-r-test] } }
- name: "Release"
env: CMAKE_OPTIONS='-DCMAKE_BUILD_TYPE=Release' MATRIX_EVAL="export CC='gcc-7' CXX='g++-7'"
addons: { apt: { packages: [cmake, cmake-data, 'g++-7'], sources: [ubuntu-toolchain-r-test] } }
before_install:
- set -e; # fail on the first error
- eval "${MATRIX_EVAL}"
- |
echo "before_install: CC=${CC} CXX=${CXX}"
${CC} -v
${CXX} -v
cmake --version
install:
### Folders ###
- mkdir -p "${DEPS_DIR}"
### CMake ###
- |
if [[ ${CMAKE_VERSION} != 'default' ]]; then
CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
CMAKE_DIR="${DEPS_DIR}/cmake-${CMAKE_VERSION}"
mkdir -p "${CMAKE_DIR}"
if [[ -z "$(ls -A ${CMAKE_DIR})" ]]; then
travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C "${CMAKE_DIR}"
fi
export PATH="${CMAKE_DIR}/bin:${PATH}"
fi
export CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_C_COMPILER=${CC} -DCMAKE_RULE_MESSAGES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
### Boost ###
- |
if [[ ${BOOST_VERSION} != 'default' ]]; then
BOOST_URL="https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION//\./_}.tar.gz"
BOOST_DIR="${DEPS_DIR}/boost-${BOOST_VERSION}"
BOOST_TOOLSET=gcc
BOOST_LIBS='program_options,system,regex,serialization,log,date_time,test,filesystem'
mkdir -p "${BOOST_DIR}"
if [[ -z "$(ls -A ${BOOST_DIR})" ]]; then
BOOST_BUILD_DIR="${HOME}/boost-build"
mkdir -p "${BOOST_BUILD_DIR}"
travis_retry wget --no-check-certificate --quiet -O - "${BOOST_URL}" | tar --strip-components=1 -xz -C "${BOOST_BUILD_DIR}"
cd "${BOOST_BUILD_DIR}"
./bootstrap.sh --with-libraries="${BOOST_LIBS}" --with-toolset="${BOOST_TOOLSET}"
./b2 -d0 -q toolset="${BOOST_TOOLSET}" variant=release link=shared threading=multi runtime-link=shared install --prefix="${BOOST_DIR}"
fi
CMAKE_OPTIONS+=" -DBOOST_ROOT='${BOOST_DIR}'"
fi
before_script:
- (ccache -V && ccache --show-stats && ccache --zero-stats)
- (mkdir -p "${TRAVIS_BUILD_DIR}/Build" && cd "${TRAVIS_BUILD_DIR}/Build" && cmake .. ${CMAKE_OPTIONS})
script:
- |
echo "script: CC=${CC} CXX=${CXX}"
${CC} -v
${CXX} -v
cmake --version
- (cmake --build "${TRAVIS_BUILD_DIR}/Build" -- --no-print-directory -j$(nproc))
- (cmake --build "${TRAVIS_BUILD_DIR}/Build" --target unit-test -- --no-print-directory -j$(nproc))
after_script:
- set -e
- ccache --show-stats