2015-09-23 11:43:36 -04:00
|
|
|
# Based on https://github.com/ldionne/hana/blob/master/.travis.yml
|
|
|
|
|
|
|
|
language: cpp
|
|
|
|
sudo: false
|
|
|
|
|
2016-09-28 01:02:49 -04:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/cmake
|
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.5.2/install
|
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.6.2/install
|
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.7.1/install
|
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.1/install
|
2017-07-13 16:53:56 -04:00
|
|
|
- ${TRAVIS_BUILD_DIR}/deps/llvm-3.9.1/install
|
2016-09-28 01:02:49 -04:00
|
|
|
|
2015-09-23 11:43:36 -04:00
|
|
|
matrix:
|
|
|
|
include:
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: BUILD_TYPE=Debug
|
|
|
|
os: osx
|
|
|
|
osx_image: xcode8
|
|
|
|
compiler: clang
|
|
|
|
- env: BUILD_TYPE=Release
|
|
|
|
os: osx
|
|
|
|
osx_image: xcode8
|
2015-09-23 11:43:36 -04:00
|
|
|
compiler: clang
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: CLANG_VERSION=3.6 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: &clang36
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.6
|
2015-10-15 16:00:10 -04:00
|
|
|
- g++-5
|
2015-09-23 11:43:36 -04:00
|
|
|
sources: &sources
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.6
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: CLANG_VERSION=3.6 BUILD_TYPE=Release
|
|
|
|
os: linux
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: *clang36
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: CLANG_VERSION=3.7 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
|
|
|
addons: &clang37
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.7
|
|
|
|
- g++-5
|
|
|
|
sources: &sources
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.7
|
|
|
|
- env: CLANG_VERSION=3.7 BUILD_TYPE=Release
|
|
|
|
os: linux
|
|
|
|
addons: *clang37
|
|
|
|
- env: CLANG_VERSION=3.8 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
|
|
|
addons: &clang38
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.8
|
|
|
|
- g++-5
|
|
|
|
sources: &sources
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.8
|
|
|
|
- env: CLANG_VERSION=3.8 BUILD_TYPE=Release
|
|
|
|
os: linux
|
|
|
|
addons: *clang38
|
2017-07-13 16:53:56 -04:00
|
|
|
- env: CLANG_VERSION=3.9 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
|
|
|
addons: &clang39
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- clang-3.9
|
|
|
|
- g++-5
|
|
|
|
sources: &sources
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- llvm-toolchain-precise-3.9
|
|
|
|
- env: CLANG_VERSION=3.9 BUILD_TYPE=Release
|
|
|
|
os: linux
|
|
|
|
addons: *clang39
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: GCC_VERSION=5 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: &gcc5
|
|
|
|
apt:
|
|
|
|
packages: g++-5
|
|
|
|
sources: *sources
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: GCC_VERSION=5 BUILD_TYPE=Release
|
|
|
|
os: linux
|
2015-09-23 11:43:36 -04:00
|
|
|
addons: *gcc5
|
2016-09-28 01:02:49 -04:00
|
|
|
- env: GCC_VERSION=6 BUILD_TYPE=Debug
|
|
|
|
os: linux
|
|
|
|
addons: &gcc6
|
|
|
|
apt:
|
|
|
|
packages: g++-6
|
|
|
|
sources: *sources
|
|
|
|
- env: GCC_VERSION=6 BUILD_TYPE=Release
|
|
|
|
os: linux
|
|
|
|
addons: *gcc6
|
2015-09-23 11:43:36 -04:00
|
|
|
|
|
|
|
install:
|
2016-09-28 01:02:49 -04:00
|
|
|
- if [[ -n "$CLANG_VERSION" ]]; then export CXX=clang++-$CLANG_VERSION CC=clang-$CLANG_VERSION; fi
|
|
|
|
- if [[ -n "$GCC_VERSION" ]]; then export CXX=g++-$GCC_VERSION CC=gcc-$GCC_VERSION; fi
|
|
|
|
- JOBS=2
|
2015-09-23 11:43:36 -04:00
|
|
|
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
|
2016-09-28 01:02:49 -04:00
|
|
|
- mkdir -p "${DEPS_DIR}" && cd "${DEPS_DIR}"
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Install a recent CMake (unless already installed on OS X)
|
|
|
|
############################################################################
|
|
|
|
- |
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
|
|
|
|
if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin)" ]]; then
|
2017-04-02 15:24:42 -04:00
|
|
|
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
|
2016-09-28 01:02:49 -04:00
|
|
|
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
|
|
|
|
fi
|
|
|
|
export PATH="${DEPS_DIR}/cmake/bin:${PATH}"
|
|
|
|
else
|
|
|
|
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# [linux]: Install the right version of libc++
|
|
|
|
############################################################################
|
2015-09-23 11:43:36 -04:00
|
|
|
- |
|
2016-09-28 01:02:49 -04:00
|
|
|
if [[ -n "$CLANG_VERSION" && "${TRAVIS_OS_NAME}" == "linux" && "${STDLIB}" != "libstdc++" ]]; then
|
|
|
|
if [[ "$CLANG_VERSION" == "3.5" ]]; then LLVM_VERSION="3.5.2"; fi
|
|
|
|
if [[ "$CLANG_VERSION" == "3.6" ]]; then LLVM_VERSION="3.6.2"; fi
|
|
|
|
if [[ "$CLANG_VERSION" == "3.7" ]]; then LLVM_VERSION="3.7.1"; fi
|
|
|
|
if [[ "$CLANG_VERSION" == "3.8" ]]; then LLVM_VERSION="3.8.1"; fi
|
2017-07-13 16:53:56 -04:00
|
|
|
if [[ "$CLANG_VERSION" == "3.9" ]]; then LLVM_VERSION="3.9.1"; fi
|
2016-09-28 01:02:49 -04:00
|
|
|
LLVM_ROOT="${DEPS_DIR}/llvm-${LLVM_VERSION}"
|
2015-09-23 11:43:36 -04:00
|
|
|
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
|
|
|
|
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
|
|
|
|
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
|
2016-09-28 01:02:49 -04:00
|
|
|
if [[ -z "$(ls -A ${LLVM_ROOT}/install/include)" ]]; then
|
|
|
|
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 - "${LIBCXX_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxx"
|
|
|
|
travis_retry wget --quiet -O - "${LIBCXXABI_URL}" | tar --strip-components=1 -xJ -C "${LLVM_ROOT}/projects/libcxxabi"
|
|
|
|
(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 -j$JOBS)
|
|
|
|
(cd "${LLVM_ROOT}/build/projects/libcxxabi" && make install -j$JOBS)
|
|
|
|
fi
|
|
|
|
export CXXFLAGS="-I ${LLVM_ROOT}/install/include/c++/v1"
|
|
|
|
export LDFLAGS="-L ${LLVM_ROOT}/install/lib -lc++ -lc++abi"
|
|
|
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_ROOT}/install/lib"
|
2015-09-23 11:43:36 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
before_script:
|
2016-09-28 01:02:49 -04:00
|
|
|
- cd "${TRAVIS_BUILD_DIR}"
|
|
|
|
- cmake . -Bbuild -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_C_COMPILER="$CC" -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
|
|
- cmake --build build -- -j$JOBS
|
2015-09-23 11:43:36 -04:00
|
|
|
|
|
|
|
script:
|
2016-09-28 01:02:49 -04:00
|
|
|
- cd build
|
|
|
|
- ctest --output-on-failure -j$JOBS
|
2015-09-23 11:43:36 -04:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
email: false
|