Add travis config

This adds a travis config to build everyting on 12.04. Because 12.04 is quite old, there are a certain number of hoops that need to be jumped through in order to get things working. As a result, the build script is more complex than I'd like.
This commit is contained in:
Simon Detheridge 2015-05-28 14:21:45 +01:00
parent 74056d4c31
commit 64fdcbdfb2
2 changed files with 37 additions and 2 deletions

31
.travis.yml Normal file
View File

@ -0,0 +1,31 @@
language: cpp
sudo: true
script:
# install standard deps (currently only libtbb is fine in 12.04)
- sudo apt-get update
- sudo apt-get install libtbb-dev
# gcc from ppa, because 12.04's is too old
- sudo apt-get install python-software-properties
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.8 g++-4.8
# qt 5.4 from ppa, because 12.04 only has 4.8
# yeah, really rather unofficial ppa but it's all that exists
- sudo apt-add-repository -y ppa:beineri/opt-qt541
- sudo apt-get update
- sudo apt-get install qt54-meta-full
# glm from source, because 12.04's is too old
- git clone https://github.com/g-truc/glm.git
- cd glm && cmake . && make && sudo make install && cd ..
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
# opencl from Intel's site, because 12.04's is nonexistant
- wget http://registrationcenter.intel.com/irc_nas/2563/intel_sdk_for_ocl_applications_2012_x64.tgz
- tar -xzvf intel_sdk_for_ocl_applications_2012_x64.tgz
- sudo apt-get install alien
- sudo alien -i intel_ocl_sdk_2012_x64.rpm
- sudo ln -s /usr/lib64/libOpenCL.so /usr/lib/libOpenCL.so
# finally, run the build
- source /opt/qt54/bin/qt54-env.sh
- g++ --version
- Builds/QtCreator/build_all.sh --travis

View File

@ -3,6 +3,8 @@
REBUILD='' REBUILD=''
NVIDIA='' NVIDIA=''
NATIVE='' NATIVE=''
CONCURRENCY='-j9'
QMAKE=${QMAKE:-qmake}
while test $# -gt 0 while test $# -gt 0
do do
@ -13,6 +15,8 @@ do
;; ;;
--native) NATIVE="CONFIG += native" --native) NATIVE="CONFIG += native"
;; ;;
--travis) CONCURRENCY="-j1"
;;
--*) echo "bad option $1"; exit 1 --*) echo "bad option $1"; exit 1
;; ;;
*) echo "unrecognised argument $1"; exit 1 *) echo "unrecognised argument $1"; exit 1
@ -29,8 +33,8 @@ do
if [ "x1" = "x$REBUILD" ]; then if [ "x1" = "x$REBUILD" ]; then
make clean make clean
fi fi
qmake "$NVIDIA" "$NATIVE" $QMAKE "$NVIDIA" "$NATIVE"
make -j9 make $CONCURRENCY
if [ "x$?" != "x0" ]; then if [ "x$?" != "x0" ]; then
echo "Build failed! Check output for errors." echo "Build failed! Check output for errors."
exit 1 exit 1