fix(ci): Update build script

This commit is contained in:
Michael Carlberg 2016-10-11 16:20:19 +02:00
parent 44ca3bef2c
commit dac5a3c804

View File

@ -1,5 +1,10 @@
sudo: required sudo: required
dist: trusty dist: trusty
language: cpp
compiler:
- clang
- gcc
addons: addons:
apt: apt:
@ -11,12 +16,6 @@ addons:
- g++-5 - g++-5
- clang-3.8 - clang-3.8
language: cpp
compiler:
- clang
- gcc
cache: ccache
env: env:
global: global:
- BUILD_TYPE="Release" - BUILD_TYPE="Release"
@ -26,21 +25,51 @@ env:
- LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz" - LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
- CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz" - CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz"
cache:
ccache: true
directories:
- ${TRAVIS_BUILD_DIR}/deps/cmake
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.1/install
before_install: before_install:
- sudo apt-add-repository -y "ppa:george-edison55/george-edison" - sudo apt-add-repository -y "ppa:george-edison55/george-edison"
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get install -y cmake cmake-data libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-ewmh-dev libxcb-icccm4-dev xcb-proto python-xcbgen libboost-dev libiw-dev libasound2-dev libmpdclient-dev libjsoncpp-dev libsigc++-2.0-0c2a libsigc++-2.0-dev libfreetype6-dev libcppunit-dev
# Install packages : core
#--------------------------------------------------------------------------x
- sudo apt-get install -y cmake cmake-data libcppunit-dev libboost-dev libfreetype6-dev
# Install packages : xcb
#--------------------------------------------------------------------------x
- sudo apt-get install -y libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-ewmh-dev libxcb-icccm4-dev xcb-proto python-xcbgen
# Install packages : optional
#--------------------------------------------------------------------------x
- sudo apt-get install -y libiw-dev libasound2-dev libmpdclient-dev libjsoncpp-dev libsigc++-2.0-0c2a libsigc++-2.0-dev
install: install:
# Install dependencies in ${TRAVIS_BUILD_DIR}/deps
#--------------------------------------------------------------------------x
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- LLVM_ROOT="${DEPS_DIR}/llvm-${LLVM_VERSION}" - LLVM_ROOT="${DEPS_DIR}/llvm-${LLVM_VERSION}"
# Update python path to make sure we find the xcbgen module
#--------------------------------------------------------------------------x
- export PYTHONPATH="/usr/lib/python2.7/dist-packages:${PYTHONPATH}"
# Install a later version of cmake
#--------------------------------------------------------------------------x
- | - |
mkdir -p "${DEPS_DIR}" && cd "${DEPS_DIR}" mkdir -p "${DEPS_DIR}" && cd "${DEPS_DIR}"
if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin 2>/dev/null)" ]]; then if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin 2>/dev/null)" ]]; then
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
fi fi
export PATH="${DEPS_DIR}/cmake/bin:${PATH}" - export PATH="${DEPS_DIR}/cmake/bin:${PATH}"
if [[ -z "$(ls -A ${LLVM_ROOT}/install/include 2>/dev/null)" ]]; then
# Install LLVM libc++
#--------------------------------------------------------------------------x
- |
if [[ "${CXX}" == "clang++" ]] && [[ -z "$(ls -A ${LLVM_ROOT}/install/include 2>/dev/null)" ]]; then
mkdir -p "${LLVM_ROOT}" "${LLVM_ROOT}/build" "${LLVM_ROOT}/projects/libcxx" "${LLVM_ROOT}/projects/libcxxabi" mkdir -p "${LLVM_ROOT}" "${LLVM_ROOT}/build" "${LLVM_ROOT}/projects/libcxx" "${LLVM_ROOT}/projects/libcxxabi"
travis_retry wget --quiet -O - "${LLVM_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}" travis_retry wget --quiet -O - "${LLVM_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}"
travis_retry wget --quiet -O - "${LIBCXX_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxx" travis_retry wget --quiet -O - "${LIBCXX_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxx"
@ -48,15 +77,17 @@ install:
(cd "${LLVM_ROOT}/build" && cmake .. -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_C_COMPILER="${CC}" -DCMAKE_INSTALL_PREFIX="${LLVM_ROOT}/install" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}") (cd "${LLVM_ROOT}/build" && cmake .. -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_C_COMPILER="${CC}" -DCMAKE_INSTALL_PREFIX="${LLVM_ROOT}/install" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}")
(cd "${LLVM_ROOT}/build/projects/libcxx" && make install) (cd "${LLVM_ROOT}/build/projects/libcxx" && make install)
(cd "${LLVM_ROOT}/build/projects/libcxxabi" && make install) (cd "${LLVM_ROOT}/build/projects/libcxxabi" && make install)
export CXXFLAGS="-I ${LLVM_ROOT}/install/include/c++/v1" export CXXFLAGS="${CXXFLAGS} -I ${LLVM_ROOT}/install/include/c++/v1"
export LDFLAGS="-L ${LLVM_ROOT}/install/lib -lc++ -lc++abi" export LDFLAGS="${LDFLAGS} -L ${LLVM_ROOT}/install/lib -lc++ -lc++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_ROOT}/install/lib" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_ROOT}/install/lib"
fi fi
# Set compiler's
#--------------------------------------------------------------------------x
- if [[ "${CXX}" == "clang++" ]]; then export CXX="clang++-3.8" CC="clang-3.8" CXXFLAGS="${CXXFLAGS} -Qunused-arguments"; fi
- if [[ "${CXX}" == "g++" ]]; then export CXX="g++-5" CC="gcc-5"; fi
before_script: before_script:
- export PYTHONPATH="/usr/lib/python2.7/dist-packages:${PYTHONPATH}"
- if [ "${CXX}" = "clang++" ]; then export CXX="clang++-3.8" CC="clang-3.8" CXXFLAGS="${CXXFLAGS} -Qunused-arguments"; fi
- if [ "${CXX}" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
- eval "${CXX} --version" - eval "${CXX} --version"
- eval "${CC} --version" - eval "${CC} --version"
- cmake --version - cmake --version