language: cpp

sudo: false

cache: apt

notifications:
  email: false

_packages:
  - &default_packages
  - &GCC
    addons:
      apt:
        sources:
          - ubuntu-toolchain-r-test
        packages:
          - *default_packages
          - g++-4.9-multilib
    before_install:
      - export CC="gcc-4.9"
      - export CXX="g++-4.9"
  - &Clang
    addons:
      apt:
        sources:
          - ubuntu-toolchain-r-test
          - llvm-toolchain-precise-3.6
        packages:
          - *default_packages
          - clang-3.6
    before_install:
      - export CC="clang-3.6"
      - export CXX="clang++-3.6"

matrix:
  fast_finish: true
  include:
    # GCC
    - compiler: gcc
      <<: *GCC
      env:
    - compiler: gcc
      <<: *GCC
      env: DEBUG=1
    - compiler: gcc
      <<: *GCC
      env: DEBUG=2
    # Clang
    - compiler: clang
      <<: *Clang
      env:
    - compiler: clang
      <<: *Clang
      env: DEBUG=1
    - compiler: clang
      <<: *Clang
      env: DEBUG=2

before_script:
  - export CC="$CC -Werror"
  - export CXX="$CXX -Werror"

script:
  - make -kj DEBUG=$DEBUG

language: cpp

sudo: false

cache: apt

notifications:
  email: false

_packages:
  - &default_packages
  - &GCC
    addons:
      apt:
        sources:
          - ubuntu-toolchain-r-test
        packages:
          - *default_packages
          - g++-4.9-multilib
    before_install:
      - export CC="gcc-4.9"
      - export CXX="g++-4.9"
  - &Clang
    addons:
      apt:
        sources:
          - ubuntu-toolchain-r-test
          - llvm-toolchain-precise-3.6
        packages:
          - *default_packages
          - clang-3.6
    before_install:
      - export CC="clang-3.6"
      - export CXX="clang++-3.6"

matrix:
  fast_finish: true
  include:
    # GCC
    - compiler: gcc
      <<: *GCC
      env:
    - compiler: gcc
      <<: *GCC
      env: DEBUG=1
    - compiler: gcc
      <<: *GCC
      env: DEBUG=2
    # Clang
    - compiler: clang
      <<: *Clang
      env:
    - compiler: clang
      <<: *Clang
      env: DEBUG=1
    - compiler: clang
      <<: *Clang
      env: DEBUG=2
  # Due to LLVM APT outage
  allow_failures:
    - compiler: clang

before_script:
  - export CC="$CC -Werror"
  - export CXX="$CXX -Werror"

script:
  - make -kj DEBUG=$DEBUG

Allow clang builds on Travis CI to fail
Allow clang builds on Travis CI to fail
