forked from datastax/cpp-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (87 loc) · 3.28 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
language: c
dist: trusty
sudo: false
compiler:
- clang
- gcc
addons:
apt:
packages:
- libssl-dev
- libssh2-1-dev
cache:
directories:
- ${HOME}/dependencies
env:
global:
- BOOST_VERSION=1.64.0
- BOOST_FILE_VERSION=1_64_0
- PROCS=2
matrix:
- LIBUV_VERSION=0.10.x EXACT_LIBUV_VERSION=0.10.37
- LIBUV_VERSION=1.x EXACT_LIBUV_VERSION=1.14.0
install:
- if [ ! -d "${HOME}/dependencies/libuv-${LIBUV_VERSION}" ]; then
wget -q --no-check-certificate http://dist.libuv.org/dist/v${EXACT_LIBUV_VERSION}/libuv-v${EXACT_LIBUV_VERSION}.tar.gz;
tar xzf libuv-v${EXACT_LIBUV_VERSION}.tar.gz;
(
cd libuv-v${EXACT_LIBUV_VERSION};
if [ "${LIBUV_VERSION}" == "0.10.x" ]; then
make -j${PROCS};
mkdir -p ${HOME}/dependencies/libuv-${LIBUV_VERSION}/lib;
cp libuv* ${HOME}/dependencies/libuv-${LIBUV_VERSION}/lib;
cp -r include ${HOME}/dependencies/libuv-${LIBUV_VERSION};
(
cd ${HOME}/dependencies/libuv-${LIBUV_VERSION}/lib;
ln -s libuv.so libuv.so.0.10;
)
elif [ "${LIBUV_VERSION}" == "1.x" ]; then
sh autogen.sh;
./configure --prefix=${HOME}/dependencies/libuv-${LIBUV_VERSION};
make -j${PROCS} install;
fi;
)
else echo "Using Cached libuv v${LIBUV_VERSION}. Dependency does not need to be re-compiled";
fi
- if [ ! -d "${HOME}/dependencies/boost_${BOOST_FILE_VERSION}" ]; then
wget -q --no-check-certificate http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_FILE_VERSION}.tar.gz/download -O boost_${BOOST_FILE_VERSION}.tar.gz;
tar xzf boost_${BOOST_FILE_VERSION}.tar.gz;
(
cd boost_${BOOST_FILE_VERSION};
./bootstrap.sh --with-libraries=chrono,system,thread,test --prefix=${HOME}/dependencies/boost_${BOOST_FILE_VERSION};
./b2 -j${PROCS} install;
)
else echo "Using Cached Boost v${BOOST_VERSION}. Dependency does not need to be re-compiled";
fi
before_script:
- EXTRA_CXX_FLAGS=
- EXTRA_C_FLAGS=
- if [ "$CXX" == "clang " ]; then
EXTRA_CXX_FLAGS="-Wno-unknown-warning-option -Wno-gnu-folding-constant -Wno-sign-compare";
EXTRA_C_FLAGS="-Wno-unknown-warning-option";
fi
- (
mkdir build;
cd build;
CFLAGS="${EXTRA_C_FLAGS}" CXXFLAGS="${EXTRA_CXX_FLAGS}" cmake -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT_DIR=${HOME}/dependencies/boost_${BOOST_FILE_VERSION} -DLIBUV_ROOT_DIR=${HOME}/dependencies/libuv-${LIBUV_VERSION}/ -DCASS_BUILD_STATIC=On -DCASS_BUILD_EXAMPLES=On -DCASS_BUILD_TESTS=On ..
)
script:
- make -C build -j${PROCS}
- build/cassandra-unit-tests
- if [ -f build/libcassandra_static.a ]; then
declare -a FUNCTIONS MISSING_FUNCTIONS;
FUNCTIONS=($(grep -Eoh '^cass_\s*(\w )\s*\(' include/cassandra.h | awk -F '(' '{print $1}'));
for function in "${FUNCTIONS[@]}"; do
nm build/libcassandra_static.a | grep ${function} > /dev/null;
if [ $? -ne 0 ]; then
MISSING_DEFINITION =("${function}");
fi;
done;
if [ ! -z "${MISSING_DEFINITION}" ]; then
printf "Function(s) have no definition:\n";
for function in ${MISSING_DEFINITION[@]}; do
printf " ${function}\n";
done;
exit 1;
fi;
fi