language: cpp
compiler:
  - gcc
  - clang

dist: trusty
sudo: required

before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq

install:
  # Install valgrind
  - sudo apt-get install valgrind
  - valgrind --version

before_script:
  - cat /proc/cpuinfo

script:
  - make
  - make test
  - valgrind --leak-check=full --error-exitcode=1  ./shallowbluetest exclude:[perft]

language: cpp
compiler:
  - gcc
  - clang

dist: trusty
sudo: required

before_install:
  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  - sudo apt-get update -qq

install:
  - sudo apt-get install valgrind

  # Use binutils 2.26 if this is a clang build (needed for LTO)
  - if [ $CXX == "clang++" ]; then sudo apt-get install binutils-2.26; fi
  - if [ $CXX == "clang++" ]; then export PATH=/usr/lib/binutils-2.26/bin:${PATH}; fi

before_script:
  # Required with clang builds on Travis so that LLVM has access to LLVMgold.so
  - if [ $CXX == "clang++" ]; then sudo ln -s /usr/lib/llvm-3.4/lib/LLVMgold.so /usr/local/clang-5.0.0/lib/LLVMgold.so; fi

script:
  - make
  - make test
  - valgrind --leak-check=full --error-exitcode=1  ./shallowbluetest exclude:[perft]

Make clang builds work on Travis
Make clang builds work on Travis

- Install binutils 2.26 when building with clang
- Symlink LLVMgold.so to where clang is installed in /usr/local
