{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "base",
      "hidden": true,
      "generator": "Ninja",
      "cacheVariables": {
        "CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
      }
    },
    {
      "name": "debug",
      "displayName": "Debug Unix",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/debug",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_C_COMPILER_LAUNCHER": "ccache",
        "CMAKE_C_FLAGS": "",
        "CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=mold",
        "CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=mold",
        "BALLISTIC_BUILD_TESTS": "ON",
        "BALLISTIC_COMPILER_FLAGS": "-Wall -Wextra -Werror -Wconversion -Wsign-conversion -Wshadow -Wstrict-prototypes -fstack-protector-strong -Wpadded -Wvla -fstrict-aliasing -fno-omit-frame-pointer -ftrivial-auto-var-init=zero -gsplit-dwarf -g",
        "BALLISTIC_LINKER_FLAGS": "",
        "BALLISTIC_SANITIZERS": "-fsanitize=address,undefined",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "OFF"
      }
    },
    {
      "name": "debug-coverage",
      "displayName": "Debug Linux (Coverage)",
      "inherits": "debug",
      "binaryDir": "${sourceDir}/build/debug-coverage",
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Linux"
      },
      "cacheVariables": {
        "CMAKE_C_FLAGS": "--coverage -fprofile-arcs -ftest-coverage -O0",
        "CMAKE_EXE_LINKER_FLAGS": "--coverage",
        "CMAKE_SHARED_LINKER_FLAGS": "--coverage",
        "BALLISTIC_BUILD_TESTS": "ON",
        "BALLISTIC_SANITIZERS": ""
      }
    },
    {
      "name": "release",
      "displayName": "Release Unix",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/release",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_C_COMPILER": "clang",
        "CMAKE_C_COMPILER_LAUNCHER": "ccache",
        "CMAKE_C_FLAGS": "-ffile-prefix-map=${sourceDir}=. -O3",
        "CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=lld",
        "CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=lld",
        "BALLISTIC_BUILD_TESTS": "OFF",
        "BALLISTIC_COMPILER_FLAGS": "-fstrict-aliasing -fno-omit-frame-pointer -ffunction-sections -fdata-sections -flto=full",
        "BALLISTIC_LINKER_FLAGS": "-Wl,--gc-sections",
        "BALLISTIC_SANITIZERS": "",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "ON"
      }
    },
    {
      "name": "debug-macOS",
      "displayName": "Debug macOS",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/debug",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_C_COMPILER": "clang",
        "BALLISTIC_COMPILER_FLAGS": "-Wall -Wextra -Werror -Wconversion -Wsign-conversion -Wshadow -Wstrict-prototypes -fstack-protector-strong -Wpadded -Wvla -fstrict-aliasing -fno-omit-frame-pointer -ftrivial-auto-var-init=zero -gsplit-dwarf -g",
        "BALLISTIC_LINKER_FLAGS": "",
        "BALLISTIC_SANITIZERS": "-fsanitize=address,undefined",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "OFF"
      }
    },
    {
      "name": "release-macOS",
      "displayName": "Release macOS",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/release",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_C_COMPILER": "clang",
        "BALLISTIC_COMPILER_FLAGS": "-fstrict-aliasing -fno-omit-frame-pointer -ffunction-sections -fdata-sections -flto=full",
        "BALLISTIC_LINKER_FLAGS": "-Wl,--gc-sections",
        "BALLISTIC_SANITIZERS": "",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "ON"
      }
    },
    {
      "name": "debug-windows",
      "displayName": "Debug Windows",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/debug",
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Windows"
      },
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "CMAKE_C_COMPILER": "clang-cl",
        "CMAKE_C_COMPILER_LAUNCHER": "sccache",
        "CMAKE_C_FLAGS": "-MP -DNOMINMAX -DWIN32_LEAN_AND_MEAN",
        "CMAKE_EXE_LINKER_FLAGS": "",
        "CMAKE_SHARED_LINKER_FLAGS": "",
        "BALLISTIC_BUILD_TESTS": "ON",
        "BALLISTIC_COMPILER_FLAGS": "-fstrict-aliasing -fno-omit-frame-pointer -ftrivial-auto-var-init=zero -gsplit-dwarf",
        "BALLISTIC_LINKER_FLAGS": "",
        "BALLISTIC_SANITIZERS": "",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "OFF"
      }
    },
    {
      "name": "release-windows",
      "displayName": "Release Windows",
      "inherits": "base",
      "binaryDir": "${sourceDir}/build/release",
      "condition": {
        "type": "equals",
        "lhs": "${hostSystemName}",
        "rhs": "Windows"
      },
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_C_COMPILER": "clang-cl",
        "CMAKE_C_COMPILER_LAUNCHER": "sccache",
        "CMAKE_C_FLAGS": "-MP -DNOMINMAX -DWIN32_LEAN_AND_MEAN -GL -O2",
        "CMAKE_EXE_LINKER_FLAGS": "-LTCG:incremental -OPT:REF -OPT:ICF",
        "CMAKE_SHARED_LINKER_FLAGS": "-LTCG:incremental -OPT:REF -OPT:ICF",
        "BALLISTIC_BUILD_TESTS": "OFF",
        "BALLISTIC_COMPILER_FLAGS": "-fstrict-aliasing -fno-omit-frame-pointer -ffunction-sections -fdata-sections -flto=full",
        "BALLISTIC_LINKER_FLAGS": "-Wl,--gc-sections",
        "BALLISTIC_SANITIZERS": "",
        "BALLISTIC_ENABLE_LINK_TIME_OPTIMIZATION": "ON"
      }
    }
  ],
  "buildPresets": [
    {
      "name": "debug",
      "configurePreset": "debug"
    },
    {
      "name": "debug-coverage",
      "configurePreset": "debug-coverage"
    },
    {
      "name": "release",
      "configurePreset": "release"
    },
    {
      "name": "debug-windows",
      "configurePreset": "debug-windows"
    },
    {
      "name": "release-windows",
      "configurePreset": "release-windows"
    },
    {
      "name": "debug-macOS",
      "configurePreset": "debug-macOS"
    },
    {
      "name": "release-macOS",
      "configurePreset": "release-macOS"
    }
  ],
  "testPresets": [
    {
      "name": "debug",
      "configurePreset": "debug",
      "output": {
        "outputOnFailure": true,
        "verbosity": "verbose"
      },
      "execution": {
        "noTestsAction": "error",
        "jobs": 0
      }
    },
    {
      "name": "debug-windows",
      "configurePreset": "debug-windows",
      "output": {
        "outputOnFailure": true,
        "verbosity": "verbose"
      },
      "execution": {
        "noTestsAction": "error",
        "jobs": 0
      }
    },
    {
      "name": "debug-macOS",
      "configurePreset": "debug-macOS",
      "output": {
        "outputOnFailure": true,
        "verbosity": "verbose"
      },
      "execution": {
        "noTestsAction": "error",
        "jobs": 0
      }
    }
  ]
}