forked from missio-cpp/missio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.sh
executable file
·86 lines (57 loc) · 1.49 KB
/
.travis.sh
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
#!/bin/sh
if [ -z "${TRAVIS}" ]
then
echo "This script is designed to run in Travis CI environment"
exit 1
fi
if [ -z "${BOOST_VERSION}" ]
then
BOOST_VERSION=1.63.0
fi
DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
install_boost()
{
BOOST_NAME="boost_$(echo ${BOOST_VERSION} | sed "s/\./_/g")"
BOOST_DIR="${DEPS_DIR}/${BOOST_NAME}"
mkdir -p "${BOOST_DIR}"
if [ -z "$(ls -A "${BOOST_DIR}")" ]
then
echo "Downloading and preparing Boost ${BOOST_VERSION}"
BOOST_URL="http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/${BOOST_NAME}.tar.gz"
wget --no-check-certificate -O - $BOOST_URL | tar --strip-components=1 -xz -C $BOOST_DIR
fi
echo "${BOOST_DIR}" > "${DEPS_DIR}/BOOST_ROOT"
}
install()
{
if [ "${VARIANT}" = "coverage" ]
then
pip install --user --upgrade cpp-coveralls
fi
mkdir -p "${DEPS_DIR}" && cd "${DEPS_DIR}"
install_boost
}
build()
{
export CC=$TRAVIS_CC
export CXX=$TRAVIS_CXX
case "${CC}" in
clang*) TOOLSET="clang";;
gcc*) TOOLSET="gcc";;
esac
export BOOST_ROOT="$(cat "${DEPS_DIR}/BOOST_ROOT")"
./build/unix/build.sh --user-config="${TRAVIS_BUILD_DIR}/user-config.jam" toolset=$TOOLSET variant=$VARIANT link=$LINK boost-link=$LINK boost=source
if [ $? -ne 0 ]
then
return $?
fi
if [ "${VARIANT}" = "coverage" ]
then
coveralls --gcov gcov-5 --gcov-options '\-lp' --exclude deps --exclude test --exclude perf
fi
}
case "$1" in
install) install;;
build) build;;
esac
cd "${TRAVIS_BUILD_DIR}"