version: '{build}'

# use an image with recent Mingw-w64 versions available on both architectures: https://www.appveyor.com/docs/windows-images-software/#mingw-msys-cygwin
image: Visual Studio 2015

cache:
- NimBinaries

matrix:
  # We always want 32-bit and 64-bit compilation
  fast_finish: false

platform:
  #- x86
  - x64

install:
  - git submodule update --init --recursive

  # use the newest versions documented here: https://www.appveyor.com/docs/windows-images-software/#mingw-msys-cygwin
  - IF "%PLATFORM%" == "x86" SET PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;%PATH%
  - IF "%PLATFORM%" == "x64" SET PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%

  - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
  - env MAKE="mingw32-make -j2" ARCH_OVERRIDE=%PLATFORM% bash build_nim.sh Nim csources dist/nimble NimBinaries
  - SET PATH=%CD%\Nim\bin;%PATH%

  # ./configure can't figure out the "MSYS_NT-6.3" platform with old autoconf files
  - curl -o vendor\libbacktrace-upstream\config.guess -L -s -S "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
  - curl -o vendor\libbacktrace-upstream\config.sub -L -s -S "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"

test_script:
  - mingw32-make test

build: off
deploy: off