{
  "version": 6,
  "cmakeMinimumRequired": { "major": 3, "minor": 23, "patch": 0 },
  "configurePresets": [
    {
      "name": "release",
      "displayName": "Release (Ninja)",
      "description": "Ninja Release. IPO/LTO intentionally OFF — GCC's IPO pass on Linux segfaulted `spectral encode --pgn -z` on real PGN. cibuildwheel (which builds the shipped wheels) doesn't enable LTO either, so this preset matches the shipped artefact. To experiment locally, pass -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE on configure.",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build/release",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release"
      }
    },
    {
      "name": "dev-debug",
      "displayName": "Debug (Ninja, -O0 -g3)",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build/debug",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_C_FLAGS_DEBUG": "-O0 -g3 -fno-omit-frame-pointer"
      }
    },
    {
      "name": "asan",
      "displayName": "AddressSanitizer + UBSan (Ninja)",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build/asan",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_C_FLAGS_DEBUG": "-O1 -g3 -fno-omit-frame-pointer -fsanitize=address,undefined",
        "CMAKE_EXE_LINKER_FLAGS": "-fsanitize=address,undefined"
      }
    },
    {
      "name": "msvc-release",
      "displayName": "MSVC Release (Visual Studio default)",
      "generator": "Visual Studio 17 2022",
      "binaryDir": "${sourceDir}/build",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release"
      },
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Windows"
      }
    }
  ],
  "buildPresets": [
    { "name": "release", "configurePreset": "release" },
    { "name": "dev-debug", "configurePreset": "dev-debug" },
    { "name": "asan", "configurePreset": "asan" },
    { "name": "msvc-release", "configurePreset": "msvc-release", "configuration": "Release" }
  ],
  "testPresets": [
    {
      "name": "release",
      "configurePreset": "release",
      "output": { "outputOnFailure": true }
    },
    {
      "name": "asan",
      "configurePreset": "asan",
      "output": { "outputOnFailure": true }
    },
    {
      "name": "msvc-release",
      "configurePreset": "msvc-release",
      "configuration": "Release",
      "output": { "outputOnFailure": true }
    }
  ]
}
