diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-09-08 22:24:28 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-09-26 14:53:28 (GMT) |
commit | e3168128841485a0a579ad3b9125fdae5e12eec8 (patch) | |
tree | 4753c54dc85043daaecd4839871a6c59bae96c0d /Source/cmCMakePresetsGraph.h | |
parent | eb6e2ef7f61de1dd4ff6ec39e886d5fa8cf9aea7 (diff) | |
download | CMake-e3168128841485a0a579ad3b9125fdae5e12eec8.zip CMake-e3168128841485a0a579ad3b9125fdae5e12eec8.tar.gz CMake-e3168128841485a0a579ad3b9125fdae5e12eec8.tar.bz2 |
CMakePresets.json: Add workflow presets to schema
Diffstat (limited to 'Source/cmCMakePresetsGraph.h')
-rw-r--r-- | Source/cmCMakePresetsGraph.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/Source/cmCMakePresetsGraph.h b/Source/cmCMakePresetsGraph.h index 806a36d..5b3e812 100644 --- a/Source/cmCMakePresetsGraph.h +++ b/Source/cmCMakePresetsGraph.h @@ -42,6 +42,7 @@ public: INVALID_MACRO_EXPANSION, BUILD_TEST_PRESETS_UNSUPPORTED, PACKAGE_PRESETS_UNSUPPORTED, + WORKFLOW_PRESETS_UNSUPPORTED, INCLUDE_UNSUPPORTED, INVALID_INCLUDE, INVALID_CONFIGURE_PRESET, @@ -51,6 +52,8 @@ public: TOOLCHAIN_FILE_UNSUPPORTED, CYCLIC_INCLUDE, TEST_OUTPUT_TRUNCATION_UNSUPPORTED, + INVALID_WORKFLOW_STEPS, + WORKFLOW_STEP_UNREACHABLE_FROM_FILE, }; std::string errors; @@ -97,7 +100,7 @@ public: std::string Name; std::vector<std::string> Inherits; - bool Hidden; + bool Hidden = false; File* OriginFile; std::string DisplayName; std::string Description; @@ -363,6 +366,43 @@ public: ReadFileResult VisitPresetAfterInherit(int /* version */) override; }; + class WorkflowPreset : public Preset + { + public: + WorkflowPreset() = default; + WorkflowPreset(WorkflowPreset&& /*other*/) = default; + WorkflowPreset(const WorkflowPreset& /*other*/) = default; + WorkflowPreset& operator=(const WorkflowPreset& /*other*/) = default; + ~WorkflowPreset() override = default; +#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) + WorkflowPreset& operator=(WorkflowPreset&& /*other*/) = default; +#else + // The move assignment operators for several STL classes did not become + // noexcept until C++17, which causes some tools to warn about this move + // assignment operator throwing an exception when it shouldn't. + WorkflowPreset& operator=(WorkflowPreset&& /*other*/) = delete; +#endif + + class WorkflowStep + { + public: + enum class Type + { + Configure, + Build, + Test, + Package, + }; + Type PresetType; + std::string PresetName; + }; + + std::vector<WorkflowStep> Steps; + + ReadFileResult VisitPresetInherit(const Preset& parent) override; + ReadFileResult VisitPresetAfterInherit(int /* version */) override; + }; + template <class T> class PresetPair { @@ -375,11 +415,13 @@ public: std::map<std::string, PresetPair<BuildPreset>> BuildPresets; std::map<std::string, PresetPair<TestPreset>> TestPresets; std::map<std::string, PresetPair<PackagePreset>> PackagePresets; + std::map<std::string, PresetPair<WorkflowPreset>> WorkflowPresets; std::vector<std::string> ConfigurePresetOrder; std::vector<std::string> BuildPresetOrder; std::vector<std::string> TestPresetOrder; std::vector<std::string> PackagePresetOrder; + std::vector<std::string> WorkflowPresetOrder; std::string SourceDir; std::vector<std::unique_ptr<File>> Files; @@ -442,6 +484,7 @@ public: void PrintPackagePresetList( const std::function<bool(const PackagePreset&)>& filter, PrintPrecedingNewline* newline = nullptr) const; + void PrintWorkflowPresetList(PrintPrecedingNewline* newline = nullptr) const; void PrintAllPresets() const; private: |