language: c
sudo: required
dist: trusty

matrix:
    include:
        - os: linux
          compiler: gcc
        - os: linux
          compiler: clang
        - os: osx
          osx_image: beta-xcode6.1
          compiler: gcc
        - os: osx
          osx_image: beta-xcode6.1
          compiler: clang
        - os: osx
          osx_image: beta-xcode6.2
          compiler: gcc
        - os: osx
          osx_image: beta-xcode6.2
          compiler: clang
        - os: osx
          osx_image: beta-xcode6.3
          compiler: gcc
        - os: osx
          osx_image: beta-xcode6.3
          compiler: clang
        - os: osx
          osx_image: xcode6.4
          compiler: gcc
        - os: osx
          osx_image: xcode6.4
          compiler: clang
        - os: osx
          osx_image: xcode7
          compiler: gcc
        - os: osx
          osx_image: xcode7
          compiler: clang
        - os: osx
          osx_image: xcode7.1
          compiler: gcc
        - os: osx
          osx_image: xcode7.1
          compiler: clang
        - os: osx
          osx_image: xcode7.2
          compiler: gcc
        - os: osx
          osx_image: xcode7.2
          compiler: clang
        - os: osx
          osx_image: xcode7.3
          compiler: gcc
        - os: osx
          osx_image: xcode7.3
          compiler: clang

cache:
  apt:  true
  ccache: true
  directories:
  - $HOME/srb2_cache

addons:
  apt:
    packages:
    - libsdl2-mixer-dev
    - libpng-dev
    - libgl1-mesa-dev
    - libgme-dev
    - p7zip-full

before_script:
  - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z
  - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets
  - mkdir build
  - cd build
  - cmake ..
  - set CFLAGS=-Wall -W -Werror

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi
  - mkdir -p $HOME/srb2_cache

script: make -k
