language: c

compiler:
  - i686-w64-mingw32-gcc
  - x86_64-w64-mingw32-gcc

addons:
  apt:
    packages:
      - gcc-mingw-w64
      - wine
      - cmake

env:
  - ci_buildsys=cmake
  - ci_buildsys=Makefile

jobs:
  include:
    - dist: trusty
      compiler: i586-mingw32msvc-gcc
      addons:
        apt:
          packages:
            - mingw32
            - wine
      env: ci_buildsys=cmake
      # Check that we have a real i586-mingw32msvc-gcc compiler as sometimes it is just a symlink to i686-w64-mingw32-gcc
      before_script: "i586-mingw32msvc-gcc -v 2>&1 | grep -q -x 'Target: i586-mingw32msvc'"

    - dist: trusty
      compiler: i586-mingw32msvc-gcc
      addons:
        apt:
          packages:
            - mingw32
            - wine
      env: ci_buildsys=Makefile
      # Check that we have a real i586-mingw32msvc-gcc compiler as sometimes it is just a symlink to i686-w64-mingw32-gcc
      before_script: "i586-mingw32msvc-gcc -v 2>&1 | grep -q -x 'Target: i586-mingw32msvc'"

script:
  - ci_target=${CC%-*} ./tools/ci-build.sh
