Tamas Kenez | 9b454b7 | 2015-09-23 17:43:36 +0200 | [diff] [blame] | 1 | # Based on https://github.com/ldionne/hana/blob/master/.travis.yml |
| 2 | |
| 3 | language: cpp |
| 4 | sudo: false |
| 5 | |
| 6 | matrix: |
| 7 | include: |
| 8 | - env: COMPILER=clang++-3.6 BUILD_TYPE=Debug CLANG=1 |
| 9 | compiler: clang |
| 10 | addons: &clang36 |
| 11 | apt: |
| 12 | packages: |
| 13 | - clang-3.6 |
| 14 | - cmake |
| 15 | sources: &sources |
| 16 | - ubuntu-toolchain-r-test |
| 17 | - llvm-toolchain-precise-3.6 |
| 18 | - kalakris-cmake |
| 19 | - env: COMPILER=clang++-3.6 BUILD_TYPE=Release CLANG=1 |
| 20 | compiler: clang |
| 21 | addons: *clang36 |
| 22 | - env: COMPILER=g++-5 BUILD_TYPE=Debug |
| 23 | compiler: gcc |
| 24 | addons: &gcc5 |
| 25 | apt: |
| 26 | packages: g++-5 |
| 27 | sources: *sources |
| 28 | - env: COMPILER=g++-5 BUILD_TYPE=Release |
| 29 | compiler: gcc |
| 30 | addons: *gcc5 |
| 31 | |
| 32 | install: |
| 33 | - which $COMPILER |
| 34 | - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" |
| 35 | - mkdir ${DEPS_DIR} && cd ${DEPS_DIR} |
| 36 | - | |
| 37 | if [[ "$CLANG" == 1 && "${TRAVIS_OS_NAME}" == "linux" && "${STDLIB}" != "libstdc++" ]]; then |
| 38 | if [[ "${COMPILER}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"; fi |
| 39 | if [[ "${COMPILER}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2"; fi |
| 40 | if [[ "${COMPILER}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.0"; fi |
| 41 | LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz" |
| 42 | LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz" |
| 43 | LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz" |
| 44 | mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi |
| 45 | travis_retry wget --quiet -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm |
| 46 | travis_retry wget --quiet -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx |
| 47 | travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi |
| 48 | (cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${DEPS_DIR}/llvm/install -DCMAKE_CXX_COMPILER=clang++) |
| 49 | (cd llvm/build/projects/libcxx && make install -j2) |
| 50 | (cd llvm/build/projects/libcxxabi && make install -j2) |
| 51 | export CXXFLAGS="-I ${DEPS_DIR}/llvm/install/include/c++/v1" |
| 52 | export LDFLAGS="-L ${DEPS_DIR}/llvm/install/lib -l c++ -l c++abi" |
| 53 | export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DEPS_DIR}/llvm/install/lib" |
| 54 | fi |
| 55 | |
| 56 | before_script: |
| 57 | - cd ${TRAVIS_BUILD_DIR} |
| 58 | - git clone --depth 1 https://github.com/Microsoft/unittest-cpp tests/unittest-cpp |
| 59 | - cmake -H. -Bb -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_INSTALL_PREFIX=$PWD/o -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
| 60 | - cmake --build b |
| 61 | |
| 62 | script: |
| 63 | - cd b |
| 64 | - ctest |
| 65 | |
| 66 | notifications: |
| 67 | email: false |