-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
112 lines (108 loc) · 4.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
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
language: c++
sudo: false
matrix:
include:
- os: linux
compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise
- llvm-toolchain-precise-3.7
packages:
- clang-3.8
- g++-5
- libglew-dev
- libsndfile1-dev
- libopenal-dev
- libfreetype6-dev
- libx11-xcb-dev
- udev
- libudev-dev
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- libglew-dev
- libsndfile1-dev
- libopenal-dev
- libfreetype6-dev
- libx11-xcb-dev
- udev
- libudev-dev
cache:
apt: true
directories:
- "$HOME/.travis/cmake/build/install"
- "deps/SFML/build/install"
- "deps/SFML/build-static/install"
- "deps/boost-install"
before_install:
- if [ "$CC" == "gcc" ]; then export CC=gcc-5; fi
- if [ "$CXX" == "g++" ]; then export CXX=g++-5; fi
- if [ "$CC" == "clang" ]; then export CC=clang-3.8; fi
- if [ "$CXX" == "clang++" ]; then export CXX=clang++-3.8; fi
- pushd . && cd $HOME
- git clone https://github.com/LB--/travis.git travis
- source "./travis/update-cmake.sh"
- popd
install:
- pushd .
# SFML 2.3 has new dependencies that Travis doesn't have
- cd deps/SFML
- git checkout 2.2
- popd && pushd .
# Build SFML (dynamic)
- if [ ! -d "deps/SFML/build/install/lib" ]; then export REBUILD_SFML="yes"; else export REBUILD_SFML="no"; fi
- if [ "$REBUILD_SFML" == "yes" ]; then cd deps/SFML && rm -rf build && mkdir build && cd build; fi
- if [ "$REBUILD_SFML" == "yes" ]; then cmake .. -DCMAKE_INSTALL_PREFIX="$(pwd)/install" && cmake --build . && cmake --build . --target install; fi
- if [ "$REBUILD_SFML" == "yes" ]; then cd install/lib; fi
- if [ "$REBUILD_SFML" == "no" ]; then cd deps/SFML/build/install/lib; fi
- export PATH="$(pwd):$PATH" && cd .. && export SFML_ROOT="$(pwd)"
- popd && pushd .
# Build SFML (static)
- if [ ! -d "deps/SFML/build-static/install/lib" ]; then export REBUILD_SFML_STATIC="yes"; else export REBUILD_SFML_STATIC="no"; fi
- if [ "$REBUILD_SFML_STATIC" == "yes" ]; then cd deps/SFML && rm -rf build-static && mkdir build-static && cd build-static; fi
- if [ "$REBUILD_SFML_STATIC" == "yes" ]; then cmake .. -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DBUILD_SHARED_LIBS=OFF && cmake --build . && cmake --build . --target install; fi
- if [ "$REBUILD_SFML_STATIC" == "yes" ]; then cd install; fi
- if [ "$REBUILD_SFML_STATIC" == "no" ]; then cd deps/SFML/build-static/install; fi
- export SFML_STATIC_ROOT="$(pwd)"
- popd && pushd .
# Build Boost
- if [ ! -d "deps/boost-install/lib" ]; then export REBUILD_BOOST="yes"; else export REBUILD_BOOST="no"; fi
- cd deps
- if [ "$REBUILD_BOOST" == "yes" ]; then rm -rf boost && rm -rf boost-install; fi
- if [ "$REBUILD_BOOST" == "yes" ]; then git clone --quiet --recursive https://github.com/boostorg/boost.git boost; fi
- if [ "$REBUILD_BOOST" == "yes" ]; then cd boost && chmod +x bootstrap.sh; fi
- if [ "$REBUILD_BOOST" == "yes" ]; then ./bootstrap.sh --prefix="$(pwd)/../boost-install"; fi
- if [ "$REBUILD_BOOST" == "yes" ]; then ./b2 headers; fi
- if [ "$REBUILD_BOOST" == "yes" ]; then ./b2 toolset=gcc-5 cxxflags="-std=c++14" variant=release link=static --with-filesystem --with-system install -d0; fi
- if [ "$REBUILD_BOOST" == "no" ]; then mkdir boost && cd boost; fi
- cd ../boost-install && export BOOST_ROOT="$(pwd)"
- popd
script:
- mkdir build && cd build
- cmake .. -DSFML_ROOT="$SFML_ROOT" -DBOOST_ROOT="$BOOST_ROOT"
- cmake --build .
- ctest -VV
- cd .. && mkdir build-static && cd build-static
- cmake .. -DSFML_ROOT="$SFML_STATIC_ROOT" -DSFML_STATIC_LIBRARIES=ON -DBOOST_ROOT="$BOOST_ROOT"
- cmake --build .
- ctest -VV
notifications:
email: false
irc:
channels:
- "irc.freenode.net#ChessPlusPlus"
template:
- "Build #%{build_number} at %{repository_slug}/%{branch} took %{duration}"
- "%{author} %{commit} \"%{commit_message}\" %{compare_url}"
- "%{message} %{build_url}"
webhooks:
urls:
- https://webhooks.gitter.im/e/23283bd266397b30488c