-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
145 lines (127 loc) · 6.14 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
sudo: false
language: cpp
cache:
directories:
- lib/
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.2
branches:
except:
- indev
- experimental
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
addons:
apt:
packages:
- g++-6
sources: &sources
- ubuntu-toolchain-r-test
matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include:
# Clang 3.9
# Fix this some time.
# - os: linux
# env: LLVM_VERSION=3.9.0 COMPILER=clang-3.9 COMPILERGCC=clang-3.9 BOOST_VERSION=1.63.0 POCO_VERSION=1.7.8
# compiler: clang
# packages: libcrypto++-dev
# GCC 6
- os: linux
env: COMPILER=g++-6 COMPILERGCC=gcc-6 BOOST_VERSION=1.63.0 POCO_VERSION=1.7.8
compiler: gcc
packages: libcrypto++-dev
install:
############################################################################
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/lib/
############################################################################
- DEPS_DIR="${TRAVIS_BUILD_DIR}/lib"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Setup default versions and override compiler if needed
############################################################################
- if [[ "${LLVM_VERSION}" == "default" ]]; then LLVM_VERSION=3.9.0; fi
- if [[ "${BOOST_VERSION}" == "default" ]]; then BOOST_VERSION=1.63.0; fi
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
############################################################################
# Install Boost headers
############################################################################
- |
if [[ "${BOOST_VERSION}" != "" ]]; then
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 --quiet -O - ${BOOST_URL} | tar --strip-components=1 -xz -C ${BOOST_DIR}; } || exit 1
fi
CMAKE_OPTIONS+=" -DBOOST_ROOT=${BOOST_DIR}"
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}
fi
- cmake --version
############################################################################
# Install Boost
############################################################################
- if [ ! -f "${BOOST_DIR})/stage/lib/libboost_iostreams.so" ]; then
(cd ${BOOST_DIR} && ./bootstrap.sh && ./b2 toolset=${COMPILERGCC} --with-thread --with-system --with-program_options --with-date_time --with-test --with-log --with-iostreams)
fi
############################################################################
# Install Clang, libc++ and libc++abi
# ############################################################################
# - |
# if [[ "${LLVM_VERSION}" != "" ]]; then
# LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
# if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
# 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"
# CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
# mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
# travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}
# travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
# travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
# travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
# (cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=${COMPILER})
# (cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
# (cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
# fi
# export CXXFLAGS="-isystem ${LLVM_DIR}/install/include/c++/v1"
# export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
# export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
# export PATH="${LLVM_DIR}/clang/bin:${PATH}"
# fi
# - ${CXX} --version
############################################################################
# Install Poco
############################################################################
- |
POCO_DIR=${DEPS_DIR}/poco-${POCO_VERSION}
POCO_URL="https://pocoproject.org/releases/poco-${POCO_VERSION}/poco-${POCO_VERSION}-all.tar.gz"
mkdir -p ${POCO_DIR}
travis_retry wget --quiet -O - ${POCO_URL} | tar --strip-components=1 -xz -C ${POCO_DIR}
if [ ! -f "${POCO_DIR}/lib/libPocoFoundation.so" ]; then
if [[ "${LLVM_VERSION}" != "" ]]; then
(cd ${POCO_DIR} && cmake . -DCMAKE_CXX_COMPILER=${COMPILER} && make)
else
(cd ${POCO_DIR} && cmake . -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_C_COMPILER=${COMPILERGCC} && make)
fi
fi
- |
if [ ! -f "${DEPS_DIR}/fmt/fmt/libfmt.a" ]; then
(cd ${DEPS_DIR}/fmt && cmake . && make)
fi
before_script:
############################################################################
# Go back to the root of the project and setup the build directory
############################################################################
- cd ${TRAVIS_BUILD_DIR}
- (cmake . ${CMAKE_OPTIONS})
script:
- make