-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
executable file
·131 lines (116 loc) · 5.46 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
language: cpp
matrix:
include:
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env: COMPILER=g++-7 BOOST_VERSION=default BOOST_BUILD=true
#- compiler: clang
# addons:
# apt:
# sources:
# - llvm-toolchain-trusty-4.0
# packages:
# - clang-4.0
# env: COMPILER=clang++-4.0 BOOST_VERSION=default BOOST_BUILD=true
- os: osx
osx_image: xcode9.4
env: BOOST_VERSION=default BOOST_BUILD=true
before_install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then sudo apt-get update -qq; fi
install:
############################################################################
# All the dependencies are installed in ${HOME}/deps/
############################################################################
- DEPS_DIR="${HOME}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
############################################################################
# Setup default versions and override CXX set by Travis if needed
############################################################################
- if [[ "${COMPILER}" == "default" ]]; then COMPILER=clang++-5.0; fi
- if [[ "${BOOST_VERSION}" == "default" ]]; then BOOST_VERSION=1.66.0; fi
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
- ${CXX} --version
############################################################################
# Install Boost headers
############################################################################
- |
if [[ "${BOOST_VERSION}" != "" ]]; then
BOOST_DIR=${DEPS_DIR}/boost-${BOOST_VERSION}
if [[ "${BOOST_VERSION}" == "trunk" ]]; then
BOOST_URL="http://github.com/boostorg/boost.git"
travis_retry git clone --depth 1 --recursive ${BOOST_URL} ${BOOST_DIR} || exit 1
(cd ${BOOST_DIR} && ./bootstrap.sh && ./b2 headers) || exit 1
else
BOOST_URL="https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/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
#CMAKE_OPTIONS+=" -DBOOST_ROOT=${BOOST_DIR}"
fi
############################################################################
# Install a recent CMake
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="https://cmake.org/files/v3.10/cmake-3.10.0-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
- cmake --version
############################################################################
# Install libc++ and libc++abi if needed
############################################################################
- |
if [[ "${CXX%%+*}" == "clang" ]]; then
if [[ "${CXX}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2";
elif [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1";
elif [[ "${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.1";
elif [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.1";
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 || exit 1
travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx || exit 1
travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi || exit 1
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install) || exit 1
(cd llvm/build/projects/libcxx && make install -j2) || exit 1
(cd llvm/build/projects/libcxxabi && make install -j2) || exit 1
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.Build
############################################################################
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo apt-get install libboost-all-dev
sudo apt-get install libncurses-dev
else
(cd ${BOOST_DIR} && ./bootstrap.sh && ./b2 install --with-filesystem --prefix=${DEPS_DIR}/b2 > b2_log)
CMAKE_OPTIONS+=" -DBOOST_ROOT=${DEPS_DIR}/b2"
brew install ncurses
fi
script:
- cd ~/build/agehama
- ls -la
- cd Pita
- mkdir build
- cd build
- CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER=${COMPILER}"
- cmake .. ${CMAKE_OPTIONS}
#- cmake -DCMAKE_CXX_COMPILER=$COMPILER ..
- make -j4
- travis_wait 999 ctest -R pita_easy -V