2017-08-15 20:35:56 +02:00
|
|
|
language: cpp
|
2018-07-31 11:33:35 +02:00
|
|
|
sudo: false
|
2017-08-15 20:35:56 +02:00
|
|
|
|
2017-08-15 21:26:23 +02:00
|
|
|
matrix:
|
2018-07-31 11:33:35 +02:00
|
|
|
exclude: # On OSX g++ is a symlink to clang++ by default
|
|
|
|
- os: osx
|
|
|
|
compiler: gcc
|
|
|
|
|
2017-08-15 21:26:23 +02:00
|
|
|
include:
|
2019-06-17 21:01:12 +02:00
|
|
|
# Bionic Ubuntu 18.04
|
2018-07-31 11:33:35 +02:00
|
|
|
- os: linux
|
2020-01-02 12:48:14 +01:00
|
|
|
name: "Bionic - gcc 7.4.0"
|
2019-06-17 21:01:12 +02:00
|
|
|
dist: bionic # We can't install packages on Bionic, not sure why. Travis ignores addons...
|
2018-07-31 11:33:35 +02:00
|
|
|
compiler: gcc
|
2019-06-17 21:01:12 +02:00
|
|
|
# Bionic Ubuntu 18.04
|
|
|
|
- os: linux
|
2020-01-02 12:48:14 +01:00
|
|
|
name: "Bionic - clang 7"
|
2019-06-17 21:01:12 +02:00
|
|
|
dist: bionic # We can't install packages on Bionic, not sure why. Travis ignores addons...
|
|
|
|
compiler: clang
|
|
|
|
|
|
|
|
# clang-6
|
|
|
|
- os: linux
|
|
|
|
name: "Xenial - clang 6"
|
|
|
|
dist: xenial
|
|
|
|
env: [USE_CC='/usr/bin/clang-6.0', USE_CXX='/usr/bin/clang++-6.0']
|
2018-07-31 11:33:35 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
2020-01-02 12:48:14 +01:00
|
|
|
packages: ['clang-6.0', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
|
|
|
|
sources: ['ubuntu-toolchain-r-test', 'ubuntu-toolchain-r-test']
|
2019-06-17 21:01:12 +02:00
|
|
|
# clang-8
|
|
|
|
- os: linux
|
|
|
|
name: "Xenial - clang 8"
|
|
|
|
dist: xenial
|
|
|
|
env: [USE_CC='/usr/bin/clang-8', USE_CXX='/usr/bin/clang++-8']
|
|
|
|
addons:
|
|
|
|
apt:
|
2020-01-02 12:48:14 +01:00
|
|
|
packages: ['clang-8', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
|
|
|
|
sources: ['llvm-toolchain-xenial-8', 'ubuntu-toolchain-r-test']
|
|
|
|
# clang-9
|
2018-07-31 11:33:35 +02:00
|
|
|
- os: linux
|
2020-01-02 12:48:14 +01:00
|
|
|
name: "Xenial - clang 9"
|
2019-06-17 21:01:12 +02:00
|
|
|
dist: xenial
|
2020-01-02 12:48:14 +01:00
|
|
|
env: [USE_CC='/usr/bin/clang-9', USE_CXX='/usr/bin/clang++-9']
|
2019-06-17 21:01:12 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
2020-01-02 12:48:14 +01:00
|
|
|
sources:
|
|
|
|
- ubuntu-toolchain-r-test
|
|
|
|
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
|
|
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
|
|
|
packages: ['clang-9', 'cmake', 'libstdc++-9-dev', 'libstdc++6']
|
|
|
|
|
2019-06-17 21:01:12 +02:00
|
|
|
# gcc-8
|
|
|
|
- os: linux
|
|
|
|
name: "Xenial - gcc 8"
|
|
|
|
dist: xenial
|
|
|
|
env: [USE_CC='/usr/bin/gcc-8', USE_CXX='/usr/bin/g++-8']
|
2018-07-31 11:33:35 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
2019-06-17 21:01:12 +02:00
|
|
|
packages: ['gcc-8', 'g++-8', 'cmake']
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
|
|
|
# gcc-9
|
|
|
|
- os: linux
|
|
|
|
name: "Xenial - gcc 9"
|
|
|
|
dist: xenial
|
|
|
|
env: [USE_CC='/usr/bin/gcc-9', USE_CXX='/usr/bin/g++-9']
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages: ['gcc-9', 'g++-9', 'cmake']
|
|
|
|
sources: ['ubuntu-toolchain-r-test']
|
2017-08-15 21:26:23 +02:00
|
|
|
|
2018-07-31 11:33:35 +02:00
|
|
|
- os: osx
|
2020-01-02 12:48:14 +01:00
|
|
|
osx_image: xcode10.3
|
2018-07-31 11:33:35 +02:00
|
|
|
compiler: clang
|
2019-06-17 21:01:12 +02:00
|
|
|
- os: osx
|
2020-01-02 12:48:14 +01:00
|
|
|
osx_image: xcode11.3
|
2019-06-17 21:01:12 +02:00
|
|
|
compiler: clang
|
2017-08-15 21:26:23 +02:00
|
|
|
|
|
|
|
|
2018-07-31 11:33:35 +02:00
|
|
|
before_install:
|
2019-06-17 21:01:12 +02:00
|
|
|
# Override compilers set by Travis
|
|
|
|
- if [ ! -z "${USE_CC}" ]; then echo "Override CC=${USE_CC}"; eval "CC=${USE_CC}"; fi
|
|
|
|
- if [ ! -z "${USE_CXX}" ]; then echo "Override CXX=${USE_CXX}"; eval "CXX=${USE_CXX}"; fi
|
|
|
|
- echo ${CC} && ${CC} --version
|
|
|
|
- echo ${CXX} && ${CXX} --version
|
2018-07-31 11:33:35 +02:00
|
|
|
# Install catch 2 dependency
|
2020-01-02 12:48:14 +01:00
|
|
|
- wget https://github.com/catchorg/Catch2/archive/v2.11.1.zip
|
|
|
|
- unzip v2.11.1.zip && cd Catch2-2.11.1 && mkdir -p build/ && cd build/
|
2019-06-17 21:01:12 +02:00
|
|
|
- cmake -DCMAKE_BUILD_TYPE=Release .. -DCMAKE_CXX_STANDARD=14 -DCMAKE_INSTALL_PREFIX=~/.local/ && cmake --build . --target install
|
2018-07-31 11:33:35 +02:00
|
|
|
- cd ../..
|
2017-08-15 20:35:56 +02:00
|
|
|
|
|
|
|
script:
|
2018-07-31 11:33:35 +02:00
|
|
|
#Build & Install library
|
|
|
|
- (mkdir -p lib/build-debug/ && cd lib/build-debug && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . --target install)
|
|
|
|
- (mkdir -p lib/build-release/ && cd lib/build-release && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . --target install)
|
|
|
|
# Run tests
|
2020-01-02 12:48:14 +01:00
|
|
|
- (mkdir -p test/build-debug/ && cd test/build-debug && cmake ${EXTRA_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . && ctest -V .)
|
|
|
|
- (mkdir -p test/build-release/ && cd test/build-release && cmake ${EXTRA_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/ .. && cmake --build . && ctest -V .)
|
2018-07-31 11:33:35 +02:00
|
|
|
|