#pragma once #include #include #include #include "breeze/Project.hpp" /// The project's CMake presets, which are what a platform, an architecture and a compiler mean: /// every SDK names its configure presets "--" (linux-x64-gcc, /// windows-x64-clang-cl). namespace breeze { struct Preset { std::string name; std::string description; std::string platform; // linux, macos, windows std::string arch; // x64, x86, arm32, arm64 std::string compiler; // the rest of the name: gcc, clang, msvc, clang-cl, mingw64, ... }; /// The configure presets usable on this machine (what `cmake --list-presets` shows). std::vector listPresets(const Project& project); /// What was asked for; every field is optional and compared ignoring case and punctuation /// ("ClangCl" finds clang-cl). struct PresetQuery { std::optional preset; std::optional platform; std::optional arch; std::optional compiler; }; /// The preset a command should use: the named preset; else one made from the platform, /// architecture and compiler given, the project's defaults and then this machine for whatever /// is missing; else the project's default preset; else none (the SDK's own default). Throws an /// Error that lists the choices when what was asked for doesn't exist. `note` gets a line to /// show the user when the choice involved a guess. std::optional resolvePreset(const Project& project, const Defaults& defaults, const PresetQuery& query, std::string* note = nullptr); }