language: rust
rust:
  - 1.41.0

matrix:
  include:
    # works on Precise and Trusty
    - os: linux
    - dist: xenial
      compiler: clang
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
          packages: ['clang-3.7', 'g++-5']

before_script:
  - export PATH="$PATH:$HOME/.cargo/bin"


before_install:
 - rustup component add rustfmt --toolchain 1.41.0-x86_64-unknown-linux-gnu
 - gem install bundler
 - curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal
 - export PATH="$PATH:$HOME/.cargo/bin"
 - sudo add-apt-repository ppa:beineri/opt-qt-5.14.2-xenial -y
 - sudo apt-get update -qq
 - sudo apt-get install libsodium-dev pkg-config
 - sudo apt-get install qt514base qt514websockets libgl1-mesa-dev
 - source /opt/qt514/bin/qt514-env.sh
 - chmod +x res/libsodium/buildlibsodium.sh

script:
 - qmake -v
 - clang++ -v
 - g++-5 -v
 - qmake silentdragon-lite.pro CONFIG+=release -spec linux-clang
 - make CC=clang CXX=clang++ -j2
 - make distclean
 - qmake silentdragon-lite.pro CONFIG+=release -spec linux-g++
 - res/libsodium/buildlibsodium.sh
 - make CC=gcc-5 CXX=g++-5 -j2
