# Azure Pipeline build definition
#
# Use RelWithDebInfo build configuration so that linking on Windows doesn't require the
# usually absent python debug dll.
#
# Set up the Windows python version to be the x86 (32 bit) version so that we can use the
# default cmake generator which uses the 32 bit compiler
#
variables:
  Config: 'RelWithDebInfo'
  PythonVersion: '3.7'
  PythonArch: 'x64'
  CmakeConfigExtraArgs: ''
  StaticLibs: yes

jobs:
- job: Windows_VS2019
  variables:
    CmakeConfigExtraArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
    CmakeGenerator: '-G "Visual Studio 16 2019"'
    VCPKG_DEFAULT_TRIPLET: x64-windows
  pool:
    vmImage: 'windows-2019'
  steps:
  - script: |
      choco install -y swig --version=4.0.1
      vcpkg install jsoncpp
      vcpkg integrate install
    name: InstallExtraStuff
  - template: steps.yml
- job: Windows_VS2017
  variables:
    PythonArch: 'x86'
    CmakeConfigExtraArgs: '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
    CmakeGenerator: '-G "Visual Studio 15 2017"'
    VCPKG_DEFAULT_TRIPLET: x86-windows
  pool:
    vmImage: 'vs2017-win2016'
  steps:
  - script: |
      choco install -y swig --version=4.0.1
      vcpkg install jsoncpp
      vcpkg integrate install
    name: InstallExtraStuff
  - template: steps.yml
- job: Ubuntu
  variables:
    PythonVersion: '3.8'
  pool:
    vmImage: 'ubuntu-18.04'
  steps:
  - script: sudo apt-get install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev
    name: InstallExtraStuff
  - template: steps.yml
- job: MacOS
  variables:
    PythonVersion: '3.6'
    PKG_CONFIG_PATH: '/usr/local/opt/openssl@1.1/lib/pkgconfig'
    CmakeConfigExtraArgs: '-DBUILD_RUBY=no'
  pool:
    vmImage: 'macOS-10.15'
  steps:
  - script: |
      brew update
      brew install libuv swig pkgconfig openssl@1.1 jsoncpp
    name: InstallExtraStuff
  - template: steps.yml
