version: 1.0.{build}

image: Visual Studio 2017

cache:
- c:\tools\vcpkg\installed

environment:
  matrix:
  - job_name: "Internal xxhash"
    LSQPACK_XXH: ON
    XXH_CMAKE: UNUSED
  - job_name: "External xxhash (CMake)"
    LSQPACK_XXH: OFF
    XXH_CMAKE: REQUIRE
  - job_name: "External xxhash (pkgconfig)"
    LSQPACK_XXH: OFF
    XXH_CMAKE: DISABLE

before_build:
  - git -C c:\tools\vcpkg\ fetch
  - git -C c:\tools\vcpkg\ checkout 2024.08.23
  - c:\tools\vcpkg\bootstrap-vcpkg.bat
  - vcpkg x-set-installed getopt:x64-windows xxhash:x64-windows pkgconf:x64-windows
  - cmake .
    -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
    -DVCPKG_INSTALLED_DIR=c:/tools/vcpkg/installed
    -DVCPKG_TARGET_TRIPLET=x64-windows
    -DPKG_CONFIG_EXECUTABLE=c:/tools/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
    -DCMAKE_BUILD_TYPE=Debug
    -DCMAKE_GENERATOR_PLATFORM=x64
    -DLSQPACK_TESTS=ON
    -DLSQPACK_XXH=%LSQPACK_XXH%
    -DCMAKE_%XXH_CMAKE%_FIND_PACKAGE_xxHash=ON
    -DGETOPT_INCLUDE_DIR=c:/tools/vcpkg/installed/x64-windows/include
    -DGETOPT_LIB=c:/tools/vcpkg/installed/x64-windows/lib/getopt.lib

build_script:
  - cmake --build .

before_test:
  - set PATH=%PATH%;c:\projects\ls-qpack\bin\Debug

test_script:
  - dir
  - msbuild RUN_TESTS.vcxproj 
