-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
179 lines (169 loc) · 5.53 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
branches:
only:
- master
addons:
apt:
packages: &sfml_dependices
# Needed by SFML
- libpthread-stubs0-dev
- libgl1-mesa-dev
- libx11-dev
- libx11-xcb-dev
- libxcb-image0-dev
- libxrandr-dev
- libxcb-randr0-dev
- libudev-dev
- libfreetype6-dev
- libglew-dev
- libjpeg8-dev
- libgpgme11-dev
- libsndfile1-dev
- libopenal-dev
- libjpeg62
- libstdc++-5-dev
# Debugging
- valgrind
- gdb
- g++-5
sudo: false
language: cpp
matrix:
include:
- os: linux
compiler: gcc
env:
- CMAKE_BUILD_TYPE=debug
- JOBS_LIMIT=4
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *sfml_dependices
- os: linux
compiler: clang
d: ldc
env:
- CMAKE_BUILD_TYPE=debug
- JOBS_LIMIT=4
- LLVM_VERSION=3.8.0
- LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz
addons:
apt:
sources:
# - llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
- *sfml_dependices
# llvm apt is down
#- clang
#- clang-3.8
- os: osx
osx_image: xcode7.3
env:
- CMAKE_BUILD_TYPE=debug
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *sfml_dependices
cache:
apt: true
directories:
- $HOME/.ccache
- "deps/boost-install"
- "deps/cmake"
- $HOME/clang-$LLVM_VERSION
- /usr/local/Cellar/cmake31
- /usr/local/Cellar/xz/
# This so travis stops complaining about 'private' repos when you've checked out
# the repository using ssh keys for convenience.
# disable the default submodule logic
git:
submodules: false
before_install:
# use sed to replace the SSH URL with the public URL, then init and update submodules
- sed -i' ' 's/[email protected]:/git:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
# Install g++ and gcc 4.8 for better C++11 support
- if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; g++ --version; fi
# Clang 3.8 due to C++11 and gcc-4.9 conflicts.
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "$CXX" = "clang++" ]; then
if [ -z "$(ls -A $HOME/clang-$LLVM_VERSION)" ]; then
wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
mkdir $HOME/clang-$LLVM_VERSION
tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1
fi;
llvm-$LLVM_VERSION/bin/llvm-config --version;
$HOME/clang-$LLVM_VERSION/bin/clang++ --version;
export LLVM_CONFIG="llvm-$LLVM_VERSION/bin/llvm-config";
export LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH
export CXX=$HOME/clang-$LLVM_VERSION/bin/clang++
export CC=$HOME/clang-$LLVM_VERSION/bin/clang
fi
install:
- export DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
- pushd .
- cd ${DEPS_DIR}
- pushd .
- if [ ! -d "${DEPS_DIR}/cmake/bin/" ]; then export REBUILD_CMAKE="yes"; else export REBUILD_CMAKE="no"; fi
# Build CMAKE
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [ "$REBUILD_CMAKE" == "yes" ]; then
rm -rf cmake
CMAKE_URL="http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz"
mkdir cmake && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
else
brew update
brew unlink cmake
brew install xz
brew install homebrew/versions/cmake31 --without-docs
brew link homebrew/versions/cmake31
brew link xz
fi
- which cmake
- cmake --version
- popd && pushd .
# Build Boost
- cd ${DEPS_DIR}
- if [ ! -d "${DEPS_DIR}/boost-install/lib" ]; then export REBUILD_BOOST="yes"; else export REBUILD_BOOST="no"; fi
- |
if [ "$REBUILD_BOOST" == "yes" ]; then
rm -rf boost && rm -rf boost-install
git clone -b boost-1.59.0 --quiet --recursive https://github.com/boostorg/boost.git boost
cd boost
chmod +x bootstrap.sh
./bootstrap.sh --prefix="$(pwd)/../boost-install"
./b2 headers
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
# Use gcc as clang has problems building boost :(((
./b2 toolset=gcc-5 cxxflags="-std=c++11" link=static --with-filesystem --with-python install -d0
else
# Assume osx
./b2 cxxflags="-std=c++11" link=static --with-filesystem --with-python install -d0
fi
fi
- if [ "$REBUILD_BOOST" == "no" ]; then mkdir boost && cd boost; fi
- cd ../boost-install && export BOOST_ROOT="$(pwd)"
- popd
# End script
- popd
before_script:
# cd back to build dir before trying to run scripts
- cd ${TRAVIS_BUILD_DIR}
- ulimit -c unlimited -S
script:
- mkdir build && cd build
- cmake .. -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DENTITYX_BUILD_TESTING=0 -DBOOST_ROOT=$BOOST_ROOT
- make VERBOSE=1
#- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so valgrind --leak-check=full --error-exitcode=1 make test || (cat Testing/Temporary/LastTest.log && exit 1)
# HACK(SMA): Only do this on linux, cpack isn't working on osx due to linking issues :(
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then cpack -V; fi
after_failure:
- COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) # find core file
- if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch; fi