version: 0.2.19.{build}

#environment:

platform: 
  - x64

os: Visual Studio 2017

configuration: Release

clone_folder: c:\projects\OpenBLAS

init:
  - git config --global core.autocrlf input

clone_depth: 5

skip_tags: true

matrix:
  fast_finish: false

skip_commits:
# Add [av skip] to commit messages
  message: /\[av skip\]/

environment:
  global:
    CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
  matrix:
#    - COMPILER: clang-cl
#      WITH_FORTRAN: ON
#    - COMPILER: clang-cl
#      DYNAMIC_ARCH: ON
#      WITH_FORTRAN: OFF
#    - COMPILER: cl
#    - COMPILER: MinGW64-gcc-7.2.0-mingw
#      DYNAMIC_ARCH: OFF
#      WITH_FORTRAN: ignore
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      COMPILER: MinGW-gcc-6.3.0-32   
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      COMPILER: MinGW-gcc-5.3.0
      WITH_FORTRAN: ignore
    
install:
  - if [%COMPILER%]==[clang-cl] call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
  - if [%COMPILER%]==[clang-cl] conda update --yes -n base conda
  - if [%COMPILER%]==[clang-cl] conda config --add channels conda-forge --force
  - if [%COMPILER%]==[clang-cl] conda config --set auto_update_conda false
  - if [%COMPILER%]==[clang-cl] conda install --yes --quiet clangdev cmake ninja flang=11.0.1
  - if [%COMPILER%]==[clang-cl] call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
  - if [%COMPILER%]==[clang-cl] set "LIB=%CONDA_INSTALL_LOCN%\Library\lib;%LIB%"
  - if [%COMPILER%]==[clang-cl] set "CPATH=%CONDA_INSTALL_LOCN%\Library\include;%CPATH%"

before_build:
  - ps: if (-Not (Test-Path .\build)) { mkdir build }
  - cd build
  - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  - if [%COMPILER%]==[MinGW-gcc-5.3.0] set PATH=C:\MinGW\bin;C:\msys64\usr\bin;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
  - if [%COMPILER%]==[MinGW64-gcc-7.2.0-mingw] set PATH=C:\MinGW\bin;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
  - if [%COMPILER%]==[MinGW-gcc-6.3.0-32] set PATH=C:\msys64\usr\bin;C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw64\bin;%PATH%
  - if [%COMPILER%]==[cl] cmake -G "Visual Studio 15 2017 Win64" ..
  - if [%COMPILER%]==[MinGW64-gcc-7.2.0-mingw] cmake -G "MinGW Makefiles" -DNOFORTRAN=1 ..
  - if [%COMPILER%]==[MinGW-gcc-6.3.0-32] cmake -G "MSYS Makefiles" -DNOFORTRAN=1 ..
  - if [%COMPILER%]==[MinGW-gcc-5.3.0] cmake -G "MSYS Makefiles" -DNOFORTRAN=1 ..
  - if [%WITH_FORTRAN%]==[OFF] cmake -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MT=mt -DMSVC_STATIC_CRT=ON ..
  - if [%WITH_FORTRAN%]==[ON] cmake -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DCMAKE_MT=mt -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 ..
  - if [%USE_OPENMP%]==[ON] cmake -DUSE_OPENMP=ON ..
  - if [%DYNAMIC_ARCH%]==[ON] cmake -DDYNAMIC_ARCH=ON -DDYNAMIC_LIST='CORE2;NEHALEM;SANDYBRIDGE;BULLDOZER;HASWELL' ..

build_script:
  - cmake --build .

test_script:
  - ctest -j2
  
