version: 1.0.{build}
build_cloud: lithium
max_jobs: 2
image: Visual Studio 2019
configuration: Release
environment:
  matrix:
  - ENV_BUILD_STATIC: -DBUILD_SHARED_LIBS=TRUE -DENFORCE_TESTER=TRUE
    COMPILER: MSVC
    DO_TEST: TRUE
  - ENV_BUILD_STATIC: -DBUILD_SHARED_LIBS=FALSE
    COMPILER: MSVC
    DO_TEST: FALSE
install:
  - hostname
  - call "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
build_script:
  - set BUILDFOLDER=%CD%
  - set ORGPATH=%PATH%
  - if "%DO_TEST%" == "TRUE" echo PATH c:\Cygwin64\bin;c:\Cygwin64\usr\bin;%CD%\build-cygwin\bin;%PATH% > q.bat
  - if "%DO_TEST%" == "TRUE" powershell -Command "(gc q.bat) -replace ' ;', ';' | Out-File -encoding ASCII p.bat"
  - if "%DO_TEST%" == "TRUE" call p.bat
  - if "%DO_TEST%" == "TRUE" "C:\\Cygwin64\\bin\\bash" -c 'mkdir build-mingw;cd build-mingw;CC=x86_64-w64-mingw32-gcc cmake -G Ninja .. -DRUNNING_ON_APPVEYOR=TRUE -DBUILD_SHARED_LIBS=FALSE -DBUILD_QUAD=TRUE -DENFORCE_SSE2=TRUE -DENFORCE_SSE4=TRUE;ninja'
  - if "%DO_TEST%" == "TRUE" cd "%BUILDFOLDER%"
  - if "%DO_TEST%" == "TRUE" "C:\\Cygwin64\\bin\\bash" -c 'mkdir build-cygwin;cd build-cygwin;cmake -G Ninja -DRUNNING_ON_APPVEYOR=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE -DENFORCE_SSE2=TRUE -DENFORCE_SSE2=TRUE -DENFORCE_SSE4=TRUE ..;ninja'
  - if "%DO_TEST%" == "TRUE" cd "%BUILDFOLDER%"
  - if "%DO_TEST%" == "TRUE" del /Q /F build-cygwin\bin\iut*
  - if "%DO_TEST%" == "TRUE" echo PATH %ORGPATH%;c:\Cygwin64\bin;c:\Cygwin64\usr\bin;%CD%\build-cygwin\bin;%CD%\build\bin > q.bat
  - if "%DO_TEST%" == "TRUE" powershell -Command "(gc q.bat) -replace ' ;', ';' | Out-File -encoding ASCII p.bat"
  - if "%DO_TEST%" == "TRUE" call p.bat
  - mkdir build
  - cd build
  - cmake -G"Visual Studio 16 2019" .. -DRUNNING_ON_APPVEYOR=TRUE -DCMAKE_INSTALL_PREFIX=install -DSLEEF_SHOW_CONFIG=1 -DSLEEF_SHOW_ERROR_LOG=1 -DENFORCE_TESTER3=TRUE -DBUILD_QUAD=TRUE -DBUILD_INLINE_HEADERS=TRUE  -DENFORCE_SSE2=TRUE -DENFORCE_SSE4=TRUE -DENFORCE_AVX=TRUE -DENFORCE_FMA4=TRUE -DENFORCE_AVX2=TRUE -DENFORCE_AVX512F=TRUE %ENV_BUILD_STATIC%
  - cmake --build . --target install --config Release
  - if "%DO_TEST%" == "TRUE" (ctest --output-on-failure -j 4 -C Release)
  - cd "%BUILDFOLDER%"
  - echo PATH %ORGPATH%;c:\Cygwin64\bin;c:\Cygwin64\usr\bin;%CD%\build-cygwin\bin;%CD%\build-clang\bin > q.bat
  - powershell -Command "(gc q.bat) -replace ' ;', ';' | Out-File -encoding ASCII p.bat"
  - call p.bat
  - mkdir build-clang
  - cd build-clang
  - cmake -G Ninja .. -DRUNNING_ON_APPVEYOR=TRUE -DCMAKE_C_COMPILER:PATH="C:\Program Files\LLVM\bin\clang.exe" -DCMAKE_INSTALL_PREFIX=install -DSLEEF_SHOW_CONFIG=1 -DSLEEF_SHOW_ERROR_LOG=1 -DENFORCE_TESTER3=TRUE -DBUILD_INLINE_HEADERS=TRUE -DBUILD_QUAD=TRUE  -DENFORCE_SSE2=TRUE -DENFORCE_SSE4=TRUE -DENFORCE_AVX=TRUE -DENFORCE_FMA4=TRUE -DENFORCE_AVX2=TRUE -DENFORCE_AVX512F=TRUE %ENV_BUILD_STATIC%
  - ninja
test_script:
  - if "%DO_TEST%" == "TRUE" (ctest --output-on-failure -j 4 -C Release)
artifacts:
- path: build\install\**\*
  name: SLEEFWindowsx64
