forked from vanilla-rtb/rapid-bidder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
138 lines (125 loc) · 5.79 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
language: cpp
# sources list: https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json,
# packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
packages: [ 'g++-5', 'libstdc++-5-dev', 'cmake' ]
env: CMAKE_BUILD_TYPE=Debug BOOST_VERSION=1.60.0 BOOST_BUILD=true
- os: linux
compiler: gcc
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
packages: [ 'g++-5', 'libstdc++-5-dev', 'cmake' ]
env: CMAKE_BUILD_TYPE=Release BOOST_VERSION=1.60.0 BOOST_BUILD=true
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
# packages: [ 'libstdc++-5-dev', 'cmake' ]
# env: CMAKE_BUILD_TYPE=Debug BOOST_VERSION=1.60.0 BOOST_BUILD=true
#
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: [ 'ubuntu-toolchain-r-test', 'kalakris-cmake' ]
# packages: [ 'libstdc++-5-dev', 'cmake' ]
# env: CMAKE_BUILD_TYPE=Release BOOST_VERSION=1.60.0 BOOST_BUILD=true
# container-based builds
sudo: false
cache:
directories:
- $HOME/.ccache
#- $HOME/download
- ${TRAVIS_BUILD_DIR}/deps/boost-1.60.0
install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- mkdir -p latest-gcc-symlinks
- env
- |
if [[ "$CXX" = "g++" ]]; then
export CXX="g++-5" CC="gcc-5" BOOST_TOOLSET=gcc;
export CXXFLAGS="--param ggc-min-expand=20 --param ggc-min-heapsize=512000"
ln -s /usr/bin/${CXX} latest-gcc-symlinks/g++
ln -s /usr/bin/${CC} latest-gcc-symlinks/gcc
fi
- |
if [[ "$CXX" = "clang++" ]]; then
export BOOST_TOOLSET=clang;
ln -s /usr/bin/${CXX} latest-gcc-symlinks/clang++
ln -s /usr/bin/${CC} latest-gcc-symlinks/clang
fi
- export PATH=$PWD/latest-gcc-symlinks:$PATH
# Install newer boost compatible with gcc 5.
############################################################################
# Install Boost headers
############################################################################
- |
if [[ "${BOOST_VERSION}" != "" ]]; then
BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}
if [[ -z "$(ls -A ${BOOST_DIR})" ]]; then
if [[ "${BOOST_VERSION}" == "trunk" ]]; then
BOOST_URL="http://github.com/boostorg/boost.git"
travis_retry git clone --depth 1 --recursive --quiet ${BOOST_URL} ${BOOST_DIR} || exit 1
(cd ${BOOST_DIR} && ./bootstrap.sh && ./b2 headers)
else
##BOOST_URL="http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION//\./_}.tar.gz"
BOOST_URL="http://venediktov.github.io/boost_${BOOST_VERSION//\./_}.tar.gz"
mkdir -p ${BOOST_DIR}
##{ travis_retry wget --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
{ travis_retry wget -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
fi
fi
CMAKE_OPTIONS+=" -DBOOST_ROOT=${BOOST_DIR}"
export CMAKE_OPTIONS
fi
############################################################################
# Install Boost.Build
############################################################################
- |
if [[ "${BOOST_BUILD}" == "true" ]]; then
##(cd ${BOOST_DIR}/tools/build && ./bootstrap.sh --with-toolset=${BOOST_TOOLSET} --with-libraries=program_options,system,filesystem,regex,serialization,log && ./b2 toolset=${BOOST_TOOLSET} install --prefix=${DEPS_DIR}/b2)
(echo "using gcc : : ccache $CXX : <cflags>-std=c11 <cxxflags>-std=c++11 ;" > ~/user-config.jam)
(echo "using clang : : ccache $CXX : <cflags>-std=c11 <cxxflags>-std=c++11 ;" >> ~/user-config.jam)
(cd ${BOOST_DIR} && ./bootstrap.sh --with-toolset=${BOOST_TOOLSET} --with-libraries=program_options,system,regex,serialization,log,date_time && ./b2 toolset=${BOOST_TOOLSET} install --prefix=${BOOST_DIR})
#export PATH=${DEPS_DIR}/b2/bin:${PATH}
export PATH=${BOOST_DIR}/bin:${PATH}
fi
############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew install cmake
brew upgrade cmake
fi
before_script:
- ccache -V && ccache --show-stats && ccache --zero-stats
#- 'echo "using gcc : : ccache $CXX : <cflags>-std=c11 <cxxflags>-std=c++11 ;" > ~/user-config.jam'
#- 'echo "using clang : : ccache $CXX : <cflags>-std=c11 <cxxflags>-std=c++11 ;" >> ~/user-config.jam'
#- cd "$BOOST_ROOT"; ./b2 toolset="$BOOST_TOOLSET" threading=multi --prefix="$BOOST_DIR" -d0 install
script:
- $CXX --version
- cmake --version
############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- cd ${TRAVIS_BUILD_DIR}
- (mkdir build-vanilla && cd build-vanilla && cmake .. ${CMAKE_OPTIONS})
- (cd build-vanilla && make -j4 VERBOSE=1)
- ccache --show-stats