# DO NOT EDIT - GENERATED FROM .github/workflows-in/windows.ys

name: windows
defaults:
  run:
    shell: bash -e -x {0}
'on':
  workflow_dispatch: null
  push:
    branches:
    - master
  pull_request:
    branches:
    - '*'
env:
  PROJ_PKG_NAME: rapidyaml-
  PROJ_PFX_TARGET: ryml-
  PROJ_PFX_CMAKE: RYML_
  CMAKE_FLAGS: -DRYML_TEST_SUITE=ON
  NUM_JOBS_BUILD: null
jobs:
  vsdebug:
    if: always()
    continue-on-error: false
    name: ${{matrix.name}}bit/c++${{matrix.std}}/debug
    runs-on: windows-${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        include:
        - std: 11
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 11
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
        - std: 17
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 17
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
        - std: 20
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 20
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
    steps:
    - name: checkout (action)
      uses: actions/checkout@v4
      with:
        submodules: recursive
        fetch-depth: 0
    - name: '---------------------------------------------------------'
      run: |
        echo "Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=ON"
    - name: 'configure Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=ON'
      run: |
        rm -rf build/Debug
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Debug \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Debug \
          -DCMAKE_CXX_FLAGS_DEBUG=" /MDd /Zi /Ob0 /Od /RTC1" \
          -DCMAKE_C_FLAGS_DEBUG=" /MDd /Zi /Ob0 /Od /RTC1" \
          -DBUILD_SHARED_LIBS=ON \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=ON'
      run: |
        cmake --build build/Debug --target ryml-test-build --parallel --verbose
    - name: 'run Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=ON'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Debug --target ryml-test-run
    - name: '---------------------------------------------------------'
      run: |
        echo "Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=OFF"
    - name: 'configure Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=OFF'
      run: |
        rm -rf build/Debug
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Debug \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Debug \
          -DCMAKE_CXX_FLAGS_DEBUG=" /MDd /Zi /Ob0 /Od /RTC1" \
          -DCMAKE_C_FLAGS_DEBUG=" /MDd /Zi /Ob0 /Od /RTC1" \
          -DBUILD_SHARED_LIBS=OFF \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=OFF'
      run: |
        cmake --build build/Debug --target ryml-test-build --parallel --verbose
    - name: 'run Debug ::: /MDd /Zi /Ob0 /Od /RTC1 shared=OFF'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Debug --target ryml-test-run
    - name: '---------------------------------------------------------'
      run: |
        echo "Release ::: /MD /Os /DNDEBUG shared=OFF"
    - name: 'configure Release ::: /MD /Os /DNDEBUG shared=OFF'
      run: |
        rm -rf build/Release
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Release \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CXX_FLAGS_RELEASE=" /MD /Os /DNDEBUG" \
          -DCMAKE_C_FLAGS_RELEASE=" /MD /Os /DNDEBUG" \
          -DBUILD_SHARED_LIBS=OFF \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Release ::: /MD /Os /DNDEBUG shared=OFF'
      run: |
        cmake --build build/Release --target ryml-test-build --parallel --verbose
    - name: 'run Release ::: /MD /Os /DNDEBUG shared=OFF'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Release --target ryml-test-run
  vsrelease:
    if: always()
    continue-on-error: false
    name: ${{matrix.name}}bit/c++${{matrix.std}}/release
    runs-on: windows-${{matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        include:
        - std: 11
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 11
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
        - std: 17
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 17
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
        - std: 20
          name: vs2022/64
          os: 2022
          gen: Visual Studio 17 2022
          arch: x64
        - std: 20
          name: vs2022/32
          os: 2022
          gen: Visual Studio 17 2022
          arch: Win32
    steps:
    - name: checkout (action)
      uses: actions/checkout@v4
      with:
        submodules: recursive
        fetch-depth: 0
    - name: '---------------------------------------------------------'
      run: |
        echo "Release ::: /MD /O1 /Ob1 /DNDEBUG shared=OFF"
    - name: 'configure Release ::: /MD /O1 /Ob1 /DNDEBUG shared=OFF'
      run: |
        rm -rf build/Release
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Release \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CXX_FLAGS_RELEASE=" /MD /O1 /Ob1 /DNDEBUG" \
          -DCMAKE_C_FLAGS_RELEASE=" /MD /O1 /Ob1 /DNDEBUG" \
          -DBUILD_SHARED_LIBS=OFF \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Release ::: /MD /O1 /Ob1 /DNDEBUG shared=OFF'
      run: |
        cmake --build build/Release --target ryml-test-build --parallel --verbose
    - name: 'run Release ::: /MD /O1 /Ob1 /DNDEBUG shared=OFF'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Release --target ryml-test-run
    - name: '---------------------------------------------------------'
      run: |
        echo "Release ::: /MD /O2 /Ob2 /DNDEBUG shared=OFF"
    - name: 'configure Release ::: /MD /O2 /Ob2 /DNDEBUG shared=OFF'
      run: |
        rm -rf build/Release
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Release \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CXX_FLAGS_RELEASE=" /MD /O2 /Ob2 /DNDEBUG" \
          -DCMAKE_C_FLAGS_RELEASE=" /MD /O2 /Ob2 /DNDEBUG" \
          -DBUILD_SHARED_LIBS=OFF \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Release ::: /MD /O2 /Ob2 /DNDEBUG shared=OFF'
      run: |
        cmake --build build/Release --target ryml-test-build --parallel --verbose
    - name: 'run Release ::: /MD /O2 /Ob2 /DNDEBUG shared=OFF'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Release --target ryml-test-run
    - name: '---------------------------------------------------------'
      run: |
        echo "Release ::: /MD /O3 /Ob3 /DNDEBUG shared=OFF"
    - name: 'configure Release ::: /MD /O3 /Ob3 /DNDEBUG shared=OFF'
      run: |
        rm -rf build/Release
        export C4_EXTERN_DIR=`pwd`/build/extern
        cmake -S . -B build/Release \
          -G "${{matrix.gen}}" -A ${{matrix.arch}} \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CXX_FLAGS_RELEASE=" /MD /O3 /Ob3 /DNDEBUG" \
          -DCMAKE_C_FLAGS_RELEASE=" /MD /O3 /Ob3 /DNDEBUG" \
          -DBUILD_SHARED_LIBS=OFF \
          -DC4_CXX_STANDARD=${{matrix.std}} \
          -DRYML_CXX_STANDARD=${{matrix.std}} \
          -DRYML_BUILD_TESTS=ON \
          -DRYML_DEV=ON \
          -DRYML_BUILD_BENCHMARKS=OFF \
          -DRYML_DBG=OFF
    - name: 'build Release ::: /MD /O3 /Ob3 /DNDEBUG shared=OFF'
      run: |
        cmake --build build/Release --target ryml-test-build --parallel --verbose
    - name: 'run Release ::: /MD /O3 /Ob3 /DNDEBUG shared=OFF'
      run: |
        source .github/setenv.sh
        export CTEST_PARALLEL_LEVEL=`_c4getnumcores`
        cmake --build build/Release --target ryml-test-run
