diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2023-08-16 13:17:09 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2023-08-16 13:47:29 (GMT) |
commit | 2588bf090ce822de44a470362019c398b2165137 (patch) | |
tree | ba0352290c092787bf98fead02b98f00e942c956 | |
parent | e70749e0d65f2bad841de92d3952b9297f326a34 (diff) | |
download | CMake-2588bf090ce822de44a470362019c398b2165137.zip CMake-2588bf090ce822de44a470362019c398b2165137.tar.gz CMake-2588bf090ce822de44a470362019c398b2165137.tar.bz2 |
CMakePresets: Make error generators proper functions
And rename cmCMakePresetErrors to cmCMakePresetsErrors.
-rw-r--r-- | Source/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Source/cmCMakePresetErrors.h | 245 | ||||
-rw-r--r-- | Source/cmCMakePresetsErrors.cxx | 305 | ||||
-rw-r--r-- | Source/cmCMakePresetsErrors.h | 116 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraph.cxx | 90 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSON.cxx | 114 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONBuildPresets.cxx | 12 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx | 30 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx | 12 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONTestPresets.cxx | 28 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx | 14 |
11 files changed, 573 insertions, 396 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 3690357..62cd829 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -128,7 +128,8 @@ add_library( cmCLocaleEnvironmentScope.cxx cmCMakePath.h cmCMakePath.cxx - cmCMakePresetErrors.h + cmCMakePresetsErrors.cxx + cmCMakePresetsErrors.h cmCMakePresetsGraph.cxx cmCMakePresetsGraph.h cmCMakePresetsGraphInternal.h diff --git a/Source/cmCMakePresetErrors.h b/Source/cmCMakePresetErrors.h deleted file mode 100644 index 0db391e..0000000 --- a/Source/cmCMakePresetErrors.h +++ /dev/null @@ -1,245 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#pragma once - -#include "cmConfigure.h" // IWYU pragma: keep - -#include <cm3p/json/value.h> - -#include "cmJSONHelpers.h" -#include "cmJSONState.h" -#include "cmStringAlgorithms.h" - -namespace cmCMakePresetErrors { -const auto getPreset = [](cmJSONState* state) -> const Json::Value* { - if (state->parseStack.size() < 2) { - return nullptr; - } - std::string firstKey = state->parseStack[0].first; - if (firstKey == "configurePresets" || firstKey == "packagePresets" || - firstKey == "buildPresets" || firstKey == "testPresets") { - return state->parseStack[1].second; - } - return nullptr; -}; -const auto getPresetName = [](cmJSONState* state) -> std::string { -#if !defined(CMAKE_BOOTSTRAP) - const Json::Value* preset = getPreset(state); - if (preset != nullptr && preset->isMember("name")) { - return preset->operator[]("name").asString(); - } -#endif - return ""; -}; -const auto getVariableName = [](cmJSONState* state) -> std::string { - std::string var = state->key_after("cacheVariables"); - std::string errMsg = cmStrCat("variable \"", var, "\""); - errMsg = cmStrCat(errMsg, " for preset \"", getPresetName(state), "\""); - return errMsg; -}; -const auto FILE_NOT_FOUND = [](const std::string& filename, - cmJSONState* state) -> void { - state->AddError(cmStrCat("File not found: ", filename)); -}; -const auto INVALID_ROOT = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Invalid root object", value); -}; -const auto NO_VERSION = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("No \"version\" field", value); -}; -const auto INVALID_VERSION = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Invalid \"version\" field", value); -}; -const auto UNRECOGNIZED_VERSION = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Unrecognized \"version\" field", value); -}; -const auto INVALID_PRESETS = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Invalid \"configurePresets\" field", value); -}; -const auto INVALID_PRESET = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Invalid preset", value); -}; -const auto INVALID_PRESET_NAMED = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Invalid preset: \"", presetName, "\"")); -}; -const auto INVALID_VARIABLE = [](const Json::Value* value, - cmJSONState* state) -> void { - std::string var = cmCMakePresetErrors::getVariableName(state); - state->AddErrorAtValue(cmStrCat("Invalid CMake ", var), value); -}; -const auto DUPLICATE_PRESETS = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Duplicate preset: \"", presetName, "\"")); -}; -const auto CYCLIC_PRESET_INHERITANCE = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError( - cmStrCat("Cyclic preset inheritance for preset \"", presetName, "\"")); -}; -const auto INHERITED_PRESET_UNREACHABLE_FROM_FILE = - [](const std::string& presetName, cmJSONState* state) -> void { - state->AddError(cmStrCat("Inherited preset \"", presetName, - "\" is unreachable from preset's file")); -}; -const auto CONFIGURE_PRESET_UNREACHABLE_FROM_FILE = - [](const std::string& presetName, cmJSONState* state) -> void { - state->AddError(cmStrCat("Configure preset \"", presetName, - "\" is unreachable from preset's file")); -}; -const auto INVALID_MACRO_EXPANSION = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Invalid macro expansion in \"", presetName, "\"")); -}; -const auto BUILD_TEST_PRESETS_UNSUPPORTED = [](const Json::Value*, - cmJSONState* state) -> void { - state->AddError("File version must be 2 or higher for build and test preset " - "support"); -}; -const auto PACKAGE_PRESETS_UNSUPPORTED = [](const Json::Value*, - cmJSONState* state) -> void { - state->AddError( - "File version must be 6 or higher for package preset support"); -}; -const auto WORKFLOW_PRESETS_UNSUPPORTED = [](const Json::Value*, - cmJSONState* state) -> void { - state->AddError( - "File version must be 6 or higher for workflow preset support"); -}; -const auto INCLUDE_UNSUPPORTED = [](const Json::Value*, - cmJSONState* state) -> void { - state->AddError("File version must be 4 or higher for include support"); -}; -const auto INVALID_INCLUDE = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue("Invalid \"include\" field", value); -}; -const auto INVALID_CONFIGURE_PRESET = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError( - cmStrCat(R"(Invalid "configurePreset": ")", presetName, "\"")); -}; -const auto INSTALL_PREFIX_UNSUPPORTED = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue( - "File version must be 3 or higher for installDir preset " - "support", - value); -}; -const auto CONDITION_UNSUPPORTED = [](cmJSONState* state) -> void { - state->AddError("File version must be 3 or higher for condition support"); -}; -const auto TOOLCHAIN_FILE_UNSUPPORTED = [](cmJSONState* state) -> void { - state->AddError("File version must be 3 or higher for toolchainFile preset " - "support"); -}; -const auto CYCLIC_INCLUDE = [](const std::string& file, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Cyclic include among preset files: ", file)); -}; -const auto TEST_OUTPUT_TRUNCATION_UNSUPPORTED = - [](cmJSONState* state) -> void { - state->AddError("File version must be 5 or higher for testOutputTruncation " - "preset support"); -}; -const auto INVALID_WORKFLOW_STEPS = [](const std::string& workflowStep, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Invalid workflow step \"", workflowStep, "\"")); -}; -const auto NO_WORKFLOW_STEPS = [](const std::string& presetName, - cmJSONState* state) -> void { - state->AddError( - cmStrCat("No workflow steps specified for \"", presetName, "\"")); -}; -const auto FIRST_WORKFLOW_STEP_NOT_CONFIGURE = [](const std::string& stepName, - cmJSONState* state) -> void { - state->AddError(cmStrCat("First workflow step \"", stepName, - "\" must be a configure step")); -}; -const auto CONFIGURE_WORKFLOW_STEP_NOT_FIRST = [](const std::string& stepName, - cmJSONState* state) -> void { - state->AddError(cmStrCat("Configure workflow step \"", stepName, - "\" must be the first step")); -}; -const auto WORKFLOW_STEP_UNREACHABLE_FROM_FILE = - [](const std::string& workflowStep, cmJSONState* state) -> void { - state->AddError(cmStrCat("Workflow step \"", workflowStep, - "\" is unreachable from preset's file")); -}; -const auto CTEST_JUNIT_UNSUPPORTED = [](cmJSONState* state) -> void { - state->AddError( - "File version must be 6 or higher for CTest JUnit output support"); -}; -const auto TRACE_UNSUPPORTED = [](cmJSONState* state) -> void { - state->AddError("File version must be 7 or higher for trace preset support"); -}; -const auto UNRECOGNIZED_CMAKE_VERSION = [](const std::string& version, - int current, int required) { - return [version, current, required](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue(cmStrCat("\"cmakeMinimumRequired\" ", version, - " version ", required, - " must be less than ", current), - value); - }; -}; -const auto INVALID_PRESET_NAME = [](const Json::Value* value, - cmJSONState* state) -> void { - std::string errMsg = "Invalid Preset Name"; - if (value && value->isConvertibleTo(Json::ValueType::stringValue) && - !value->asString().empty()) { - errMsg = cmStrCat(errMsg, ": ", value->asString()); - } - state->AddErrorAtValue(errMsg, value); -}; -const auto INVALID_CONDITION = [](const Json::Value* value, - cmJSONState* state) -> void { - state->AddErrorAtValue( - cmStrCat("Invalid condition for preset \"", getPresetName(state), "\""), - value); -}; -const auto INVALID_CONDITION_OBJECT = - [](JsonErrors::ObjectError errorType, - const Json::Value::Members& extraFields) { - return JsonErrors::INVALID_NAMED_OBJECT( - [](const Json::Value*, cmJSONState* state) -> std::string { - return cmStrCat(" condition for preset \"", getPresetName(state), - "\""); - })(errorType, extraFields); - }; -const auto INVALID_VARIABLE_OBJECT = - [](JsonErrors::ObjectError errorType, - const Json::Value::Members& extraFields) { - return JsonErrors::INVALID_NAMED_OBJECT( - [](const Json::Value*, cmJSONState* state) -> std::string { - return getVariableName(state); - })(errorType, extraFields); - }; -const auto INVALID_PRESET_OBJECT = - [](JsonErrors::ObjectError errorType, - const Json::Value::Members& extraFields) { - return JsonErrors::INVALID_NAMED_OBJECT( - [](const Json::Value*, cmJSONState*) -> std::string { - return "Preset"; - })(errorType, extraFields); - }; -const auto INVALID_ROOT_OBJECT = [](JsonErrors::ObjectError errorType, - const Json::Value::Members& extraFields) { - return JsonErrors::INVALID_NAMED_OBJECT( - [](const Json::Value*, cmJSONState*) -> std::string { - return "root object"; - })(errorType, extraFields); -}; -const auto PRESET_MISSING_FIELD = [](const std::string& presetName, - const std::string& missingField, - cmJSONState* state) { - state->AddError(cmStrCat("Preset \"", presetName, "\" missing field \"", - missingField, "\"")); -}; -} diff --git a/Source/cmCMakePresetsErrors.cxx b/Source/cmCMakePresetsErrors.cxx new file mode 100644 index 0000000..e0ff0c6 --- /dev/null +++ b/Source/cmCMakePresetsErrors.cxx @@ -0,0 +1,305 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cmCMakePresetsErrors.h" + +#include <functional> +#include <utility> +#include <vector> + +#include <cm3p/json/value.h> + +#include "cmJSONHelpers.h" +#include "cmJSONState.h" +#include "cmStringAlgorithms.h" + +namespace cmCMakePresetsErrors { +const Json::Value* getPreset(cmJSONState* state) +{ + if (state->parseStack.size() < 2) { + return nullptr; + } + std::string firstKey = state->parseStack[0].first; + if (firstKey == "configurePresets" || firstKey == "packagePresets" || + firstKey == "buildPresets" || firstKey == "testPresets") { + return state->parseStack[1].second; + } + return nullptr; +} + +std::string getPresetName(cmJSONState* state) +{ + const Json::Value* preset = getPreset(state); + if (preset != nullptr && preset->isMember("name")) { + return preset->operator[]("name").asString(); + } + return ""; +} + +std::string getVariableName(cmJSONState* state) +{ + std::string var = state->key_after("cacheVariables"); + std::string errMsg = cmStrCat("variable \"", var, "\""); + errMsg = cmStrCat(errMsg, " for preset \"", getPresetName(state), "\""); + return errMsg; +} + +void FILE_NOT_FOUND(const std::string& filename, cmJSONState* state) +{ + state->AddError(cmStrCat("File not found: ", filename)); +} + +void INVALID_ROOT(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Invalid root object", value); +} + +void NO_VERSION(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("No \"version\" field", value); +} + +void INVALID_VERSION(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Invalid \"version\" field", value); +} + +void UNRECOGNIZED_VERSION(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Unrecognized \"version\" field", value); +} + +void INVALID_PRESETS(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Invalid \"configurePresets\" field", value); +} + +void INVALID_PRESET(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Invalid preset", value); +} + +void INVALID_PRESET_NAMED(const std::string& presetName, cmJSONState* state) +{ + state->AddError(cmStrCat("Invalid preset: \"", presetName, "\"")); +} + +void INVALID_VARIABLE(const Json::Value* value, cmJSONState* state) +{ + std::string var = cmCMakePresetsErrors::getVariableName(state); + state->AddErrorAtValue(cmStrCat("Invalid CMake ", var), value); +} + +void DUPLICATE_PRESETS(const std::string& presetName, cmJSONState* state) +{ + state->AddError(cmStrCat("Duplicate preset: \"", presetName, "\"")); +} + +void CYCLIC_PRESET_INHERITANCE(const std::string& presetName, + cmJSONState* state) + +{ + state->AddError( + cmStrCat("Cyclic preset inheritance for preset \"", presetName, "\"")); +} + +void INHERITED_PRESET_UNREACHABLE_FROM_FILE(const std::string& presetName, + cmJSONState* state) +{ + state->AddError(cmStrCat("Inherited preset \"", presetName, + "\" is unreachable from preset's file")); +} + +void CONFIGURE_PRESET_UNREACHABLE_FROM_FILE(const std::string& presetName, + cmJSONState* state) +{ + state->AddError(cmStrCat("Configure preset \"", presetName, + "\" is unreachable from preset's file")); +} + +void INVALID_MACRO_EXPANSION(const std::string& presetName, cmJSONState* state) +{ + state->AddError(cmStrCat("Invalid macro expansion in \"", presetName, "\"")); +} + +void BUILD_TEST_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state) +{ + state->AddError("File version must be 2 or higher for build and test preset " + "support"); +} + +void PACKAGE_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state) +{ + state->AddError( + "File version must be 6 or higher for package preset support"); +} + +void WORKFLOW_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state) +{ + state->AddError( + "File version must be 6 or higher for workflow preset support"); +} + +void INCLUDE_UNSUPPORTED(const Json::Value*, cmJSONState* state) +{ + state->AddError("File version must be 4 or higher for include support"); +} + +void INVALID_INCLUDE(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue("Invalid \"include\" field", value); +} + +void INVALID_CONFIGURE_PRESET(const std::string& presetName, + cmJSONState* state) +{ + state->AddError( + cmStrCat(R"(Invalid "configurePreset": ")", presetName, "\"")); +} + +void INSTALL_PREFIX_UNSUPPORTED(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue( + "File version must be 3 or higher for installDir preset " + "support", + value); +} + +void CONDITION_UNSUPPORTED(cmJSONState* state) +{ + state->AddError("File version must be 3 or higher for condition support"); +} + +void TOOLCHAIN_FILE_UNSUPPORTED(cmJSONState* state) +{ + state->AddError("File version must be 3 or higher for toolchainFile preset " + "support"); +} + +void CYCLIC_INCLUDE(const std::string& file, cmJSONState* state) +{ + state->AddError(cmStrCat("Cyclic include among preset files: ", file)); +} + +void TEST_OUTPUT_TRUNCATION_UNSUPPORTED(cmJSONState* state) +{ + state->AddError("File version must be 5 or higher for testOutputTruncation " + "preset support"); +} + +void INVALID_WORKFLOW_STEPS(const std::string& workflowStep, + cmJSONState* state) +{ + state->AddError(cmStrCat("Invalid workflow step \"", workflowStep, "\"")); +} + +void NO_WORKFLOW_STEPS(const std::string& presetName, cmJSONState* state) +{ + state->AddError( + cmStrCat("No workflow steps specified for \"", presetName, "\"")); +} + +void FIRST_WORKFLOW_STEP_NOT_CONFIGURE(const std::string& stepName, + cmJSONState* state) +{ + state->AddError(cmStrCat("First workflow step \"", stepName, + "\" must be a configure step")); +} + +void CONFIGURE_WORKFLOW_STEP_NOT_FIRST(const std::string& stepName, + cmJSONState* state) +{ + state->AddError(cmStrCat("Configure workflow step \"", stepName, + "\" must be the first step")); +} + +void WORKFLOW_STEP_UNREACHABLE_FROM_FILE(const std::string& workflowStep, + cmJSONState* state) +{ + state->AddError(cmStrCat("Workflow step \"", workflowStep, + "\" is unreachable from preset's file")); +} + +void CTEST_JUNIT_UNSUPPORTED(cmJSONState* state) +{ + state->AddError( + "File version must be 6 or higher for CTest JUnit output support"); +} + +void TRACE_UNSUPPORTED(cmJSONState* state) +{ + state->AddError("File version must be 7 or higher for trace preset support"); +} + +JsonErrors::ErrorGenerator UNRECOGNIZED_CMAKE_VERSION( + const std::string& version, int current, int required) +{ + return [version, current, required](const Json::Value* value, + cmJSONState* state) -> void { + state->AddErrorAtValue(cmStrCat("\"cmakeMinimumRequired\" ", version, + " version ", required, + " must be less than ", current), + value); + }; +} + +void INVALID_PRESET_NAME(const Json::Value* value, cmJSONState* state) +{ + std::string errMsg = "Invalid Preset Name"; + if (value && value->isConvertibleTo(Json::ValueType::stringValue) && + !value->asString().empty()) { + errMsg = cmStrCat(errMsg, ": ", value->asString()); + } + state->AddErrorAtValue(errMsg, value); +} + +void INVALID_CONDITION(const Json::Value* value, cmJSONState* state) +{ + state->AddErrorAtValue( + cmStrCat("Invalid condition for preset \"", getPresetName(state), "\""), + value); +} + +JsonErrors::ErrorGenerator INVALID_CONDITION_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields) +{ + return JsonErrors::INVALID_NAMED_OBJECT( + [](const Json::Value*, cmJSONState* state) -> std::string { + return cmStrCat(" condition for preset \"", getPresetName(state), "\""); + })(errorType, extraFields); +} + +JsonErrors::ErrorGenerator INVALID_VARIABLE_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields) +{ + return JsonErrors::INVALID_NAMED_OBJECT( + [](const Json::Value*, cmJSONState* state) -> std::string { + return getVariableName(state); + })(errorType, extraFields); +} + +JsonErrors::ErrorGenerator INVALID_PRESET_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields) +{ + return JsonErrors::INVALID_NAMED_OBJECT( + [](const Json::Value*, cmJSONState*) -> std::string { return "Preset"; })( + errorType, extraFields); +} + +JsonErrors::ErrorGenerator INVALID_ROOT_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields) +{ + return JsonErrors::INVALID_NAMED_OBJECT( + [](const Json::Value*, cmJSONState*) -> std::string { + return "root object"; + })(errorType, extraFields); +} + +void PRESET_MISSING_FIELD(const std::string& presetName, + const std::string& missingField, cmJSONState* state) +{ + state->AddError(cmStrCat("Preset \"", presetName, "\" missing field \"", + missingField, "\"")); +} +} diff --git a/Source/cmCMakePresetsErrors.h b/Source/cmCMakePresetsErrors.h new file mode 100644 index 0000000..14aaed7 --- /dev/null +++ b/Source/cmCMakePresetsErrors.h @@ -0,0 +1,116 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#pragma once + +#include "cmConfigure.h" // IWYU pragma: keep + +#include <string> + +#include <cm3p/json/value.h> + +#include "cmJSONHelpers.h" + +class cmJSONState; + +namespace cmCMakePresetsErrors { +const Json::Value* getPreset(cmJSONState* state); + +std::string getPresetName(cmJSONState* state); + +std::string getVariableName(cmJSONState* state); + +void FILE_NOT_FOUND(const std::string& filename, cmJSONState* state); + +void INVALID_ROOT(const Json::Value* value, cmJSONState* state); + +void NO_VERSION(const Json::Value* value, cmJSONState* state); + +void INVALID_VERSION(const Json::Value* value, cmJSONState* state); + +void UNRECOGNIZED_VERSION(const Json::Value* value, cmJSONState* state); + +void INVALID_PRESETS(const Json::Value* value, cmJSONState* state); + +void INVALID_PRESET(const Json::Value* value, cmJSONState* state); + +void INVALID_PRESET_NAMED(const std::string& presetName, cmJSONState* state); + +void INVALID_VARIABLE(const Json::Value* value, cmJSONState* state); + +void DUPLICATE_PRESETS(const std::string& presetName, cmJSONState* state); + +void CYCLIC_PRESET_INHERITANCE(const std::string& presetName, + cmJSONState* state); + +void INHERITED_PRESET_UNREACHABLE_FROM_FILE(const std::string& presetName, + cmJSONState* state); + +void CONFIGURE_PRESET_UNREACHABLE_FROM_FILE(const std::string& presetName, + cmJSONState* state); + +void INVALID_MACRO_EXPANSION(const std::string& presetName, + cmJSONState* state); + +void BUILD_TEST_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state); + +void PACKAGE_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state); + +void WORKFLOW_PRESETS_UNSUPPORTED(const Json::Value*, cmJSONState* state); + +void INCLUDE_UNSUPPORTED(const Json::Value*, cmJSONState* state); + +void INVALID_INCLUDE(const Json::Value* value, cmJSONState* state); + +void INVALID_CONFIGURE_PRESET(const std::string& presetName, + cmJSONState* state); + +void INSTALL_PREFIX_UNSUPPORTED(const Json::Value* value, cmJSONState* state); + +void CONDITION_UNSUPPORTED(cmJSONState* state); + +void TOOLCHAIN_FILE_UNSUPPORTED(cmJSONState* state); + +void CYCLIC_INCLUDE(const std::string& file, cmJSONState* state); + +void TEST_OUTPUT_TRUNCATION_UNSUPPORTED(cmJSONState* state); + +void INVALID_WORKFLOW_STEPS(const std::string& workflowStep, + cmJSONState* state); + +void NO_WORKFLOW_STEPS(const std::string& presetName, cmJSONState* state); + +void FIRST_WORKFLOW_STEP_NOT_CONFIGURE(const std::string& stepName, + cmJSONState* state); + +void CONFIGURE_WORKFLOW_STEP_NOT_FIRST(const std::string& stepName, + cmJSONState* state); + +void WORKFLOW_STEP_UNREACHABLE_FROM_FILE(const std::string& workflowStep, + cmJSONState* state); + +void CTEST_JUNIT_UNSUPPORTED(cmJSONState* state); + +void TRACE_UNSUPPORTED(cmJSONState* state); + +JsonErrors::ErrorGenerator UNRECOGNIZED_CMAKE_VERSION( + const std::string& version, int current, int required); + +void INVALID_PRESET_NAME(const Json::Value* value, cmJSONState* state); + +void INVALID_CONDITION(const Json::Value* value, cmJSONState* state); + +JsonErrors::ErrorGenerator INVALID_CONDITION_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields); + +JsonErrors::ErrorGenerator INVALID_VARIABLE_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields); + +JsonErrors::ErrorGenerator INVALID_PRESET_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields); + +JsonErrors::ErrorGenerator INVALID_ROOT_OBJECT( + JsonErrors::ObjectError errorType, const Json::Value::Members& extraFields); + +void PRESET_MISSING_FIELD(const std::string& presetName, + const std::string& missingField, cmJSONState* state); +} diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx index 2707000..d37c8a4 100644 --- a/Source/cmCMakePresetsGraph.cxx +++ b/Source/cmCMakePresetsGraph.cxx @@ -14,7 +14,7 @@ #include "cmsys/RegularExpression.hxx" -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraphInternal.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -89,8 +89,8 @@ bool VisitPreset( { switch (cycleStatus[preset.Name]) { case CycleStatus::InProgress: - cmCMakePresetErrors::CYCLIC_PRESET_INHERITANCE(preset.Name, - &graph.parseState); + cmCMakePresetsErrors::CYCLIC_PRESET_INHERITANCE(preset.Name, + &graph.parseState); return false; case CycleStatus::Verified: return true; @@ -101,27 +101,27 @@ bool VisitPreset( cycleStatus[preset.Name] = CycleStatus::InProgress; if (preset.Environment.count("") != 0) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); return false; } bool result = preset.VisitPresetBeforeInherit(); if (!result) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); return false; } for (auto const& i : preset.Inherits) { auto parent = presets.find(i); if (parent == presets.end()) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, - &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, + &graph.parseState); return false; } auto& parentPreset = parent->second.Unexpanded; if (!preset.OriginFile->ReachableFiles.count(parentPreset.OriginFile)) { - cmCMakePresetErrors::INHERITED_PRESET_UNREACHABLE_FROM_FILE( + cmCMakePresetsErrors::INHERITED_PRESET_UNREACHABLE_FROM_FILE( preset.Name, &graph.parseState); return false; } @@ -132,8 +132,8 @@ bool VisitPreset( result = preset.VisitPresetInherit(parentPreset); if (!result) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, - &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, + &graph.parseState); return false; } @@ -153,7 +153,7 @@ bool VisitPreset( result = preset.VisitPresetAfterInherit(graph.GetVersion(preset), &graph.parseState); if (!result) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, &graph.parseState); return false; } @@ -459,8 +459,8 @@ bool ExpandMacros(cmCMakePresetsGraph& graph, const T& preset, switch (VisitEnv(*v.second, envCycles[v.first], macroExpanders, graph.GetVersion(preset))) { case ExpandMacroResult::Error: - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, - &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, + &graph.parseState); return false; case ExpandMacroResult::Ignore: out.reset(); @@ -475,8 +475,8 @@ bool ExpandMacros(cmCMakePresetsGraph& graph, const T& preset, cm::optional<bool> result; if (!preset.ConditionEvaluator->Evaluate( macroExpanders, graph.GetVersion(preset), result)) { - cmCMakePresetErrors::INVALID_PRESET_NAMED(preset.Name, - &graph.parseState); + cmCMakePresetsErrors::INVALID_PRESET_NAMED(preset.Name, + &graph.parseState); return false; } if (!result) { @@ -615,7 +615,7 @@ bool SetupWorkflowConfigurePreset(const T& preset, cmJSONState* state) { if (preset.ConfigurePreset != configurePreset->Name) { - cmCMakePresetErrors::INVALID_WORKFLOW_STEPS(configurePreset->Name, state); + cmCMakePresetsErrors::INVALID_WORKFLOW_STEPS(configurePreset->Name, state); return false; } return true; @@ -638,12 +638,12 @@ bool TryReachPresetFromWorkflow( { auto it = presets.find(name); if (it == presets.end()) { - cmCMakePresetErrors::INVALID_WORKFLOW_STEPS(name, state); + cmCMakePresetsErrors::INVALID_WORKFLOW_STEPS(name, state); return false; } if (!origin.OriginFile->ReachableFiles.count( it->second.Unexpanded.OriginFile)) { - cmCMakePresetErrors::WORKFLOW_STEP_UNREACHABLE_FROM_FILE(name, state); + cmCMakePresetsErrors::WORKFLOW_STEP_UNREACHABLE_FROM_FILE(name, state); return false; } return SetupWorkflowConfigurePreset<T>(it->second.Unexpanded, @@ -793,13 +793,13 @@ bool cmCMakePresetsGraph::ConfigurePreset::VisitPresetAfterInherit( if (!preset.Hidden) { if (version < 3) { if (preset.Generator.empty()) { - cmCMakePresetErrors::PRESET_MISSING_FIELD(preset.Name, "generator", - state); + cmCMakePresetsErrors::PRESET_MISSING_FIELD(preset.Name, "generator", + state); return false; } if (preset.BinaryDir.empty()) { - cmCMakePresetErrors::PRESET_MISSING_FIELD(preset.Name, "binaryDir", - state); + cmCMakePresetsErrors::PRESET_MISSING_FIELD(preset.Name, "binaryDir", + state); return false; } } @@ -1064,7 +1064,7 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) if (allowNoFiles) { return true; } - cmCMakePresetErrors::FILE_NOT_FOUND(filename, &this->parseState); + cmCMakePresetsErrors::FILE_NOT_FOUND(filename, &this->parseState); return false; } @@ -1080,8 +1080,8 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) for (auto& it : this->ConfigurePresets) { if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) { - cmCMakePresetErrors::INVALID_MACRO_EXPANSION(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_MACRO_EXPANSION(it.first, + &this->parseState); return false; } } @@ -1091,13 +1091,13 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) const auto configurePreset = this->ConfigurePresets.find(it.second.Unexpanded.ConfigurePreset); if (configurePreset == this->ConfigurePresets.end()) { - cmCMakePresetErrors::INVALID_CONFIGURE_PRESET(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_CONFIGURE_PRESET(it.first, + &this->parseState); return false; } if (!it.second.Unexpanded.OriginFile->ReachableFiles.count( configurePreset->second.Unexpanded.OriginFile)) { - cmCMakePresetErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( + cmCMakePresetsErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( it.first, &this->parseState); return false; } @@ -1110,8 +1110,8 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) } if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) { - cmCMakePresetErrors::INVALID_MACRO_EXPANSION(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_MACRO_EXPANSION(it.first, + &this->parseState); return false; } } @@ -1121,13 +1121,13 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) const auto configurePreset = this->ConfigurePresets.find(it.second.Unexpanded.ConfigurePreset); if (configurePreset == this->ConfigurePresets.end()) { - cmCMakePresetErrors::INVALID_CONFIGURE_PRESET(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_CONFIGURE_PRESET(it.first, + &this->parseState); return false; } if (!it.second.Unexpanded.OriginFile->ReachableFiles.count( configurePreset->second.Unexpanded.OriginFile)) { - cmCMakePresetErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( + cmCMakePresetsErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( it.first, &this->parseState); return false; } @@ -1140,8 +1140,8 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) } if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) { - cmCMakePresetErrors::INVALID_MACRO_EXPANSION(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_MACRO_EXPANSION(it.first, + &this->parseState); return false; } } @@ -1151,13 +1151,13 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) const auto configurePreset = this->ConfigurePresets.find(it.second.Unexpanded.ConfigurePreset); if (configurePreset == this->ConfigurePresets.end()) { - cmCMakePresetErrors::INVALID_CONFIGURE_PRESET(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_CONFIGURE_PRESET(it.first, + &this->parseState); return false; } if (!it.second.Unexpanded.OriginFile->ReachableFiles.count( configurePreset->second.Unexpanded.OriginFile)) { - cmCMakePresetErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( + cmCMakePresetsErrors::CONFIGURE_PRESET_UNREACHABLE_FROM_FILE( it.first, &this->parseState); return false; } @@ -1170,8 +1170,8 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) } if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) { - cmCMakePresetErrors::INVALID_MACRO_EXPANSION(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_MACRO_EXPANSION(it.first, + &this->parseState); return false; } } @@ -1182,12 +1182,12 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) const ConfigurePreset* configurePreset = nullptr; for (auto const& step : it.second.Unexpanded.Steps) { if (configurePreset == nullptr && step.PresetType != Type::Configure) { - cmCMakePresetErrors::FIRST_WORKFLOW_STEP_NOT_CONFIGURE( + cmCMakePresetsErrors::FIRST_WORKFLOW_STEP_NOT_CONFIGURE( step.PresetName, &this->parseState); return false; } if (configurePreset != nullptr && step.PresetType == Type::Configure) { - cmCMakePresetErrors::CONFIGURE_WORKFLOW_STEP_NOT_FIRST( + cmCMakePresetsErrors::CONFIGURE_WORKFLOW_STEP_NOT_FIRST( step.PresetName, &this->parseState); return false; } @@ -1220,13 +1220,13 @@ bool cmCMakePresetsGraph::ReadProjectPresetsInternal(bool allowNoFiles) } if (configurePreset == nullptr) { - cmCMakePresetErrors::NO_WORKFLOW_STEPS(it.first, &this->parseState); + cmCMakePresetsErrors::NO_WORKFLOW_STEPS(it.first, &this->parseState); return false; } if (!ExpandMacros(*this, it.second.Unexpanded, it.second.Expanded)) { - cmCMakePresetErrors::INVALID_MACRO_EXPANSION(it.first, - &this->parseState); + cmCMakePresetsErrors::INVALID_MACRO_EXPANSION(it.first, + &this->parseState); return false; } } diff --git a/Source/cmCMakePresetsGraphReadJSON.cxx b/Source/cmCMakePresetsGraphReadJSON.cxx index 54fea40..8d63441 100644 --- a/Source/cmCMakePresetsGraphReadJSON.cxx +++ b/Source/cmCMakePresetsGraphReadJSON.cxx @@ -15,7 +15,7 @@ #include <cm3p/json/value.h> -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -71,18 +71,18 @@ auto const ConditionStringHelper = JSONHelperBuilder::String(); auto const ConditionBoolHelper = JSONHelperBuilder::Bool(); auto const ConditionStringListHelper = JSONHelperBuilder::Vector<std::string>( - cmCMakePresetErrors::INVALID_CONDITION, ConditionStringHelper); + cmCMakePresetsErrors::INVALID_CONDITION, ConditionStringHelper); auto const ConstConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::ConstCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("value"_s, &cmCMakePresetsGraphInternal::ConstCondition::Value, ConditionBoolHelper, true); auto const EqualsConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::EqualsCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("lhs"_s, &cmCMakePresetsGraphInternal::EqualsCondition::Lhs, ConditionStringHelper, true) @@ -91,7 +91,7 @@ auto const EqualsConditionHelper = auto const InListConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::InListCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("string"_s, &cmCMakePresetsGraphInternal::InListCondition::String, ConditionStringHelper, true) @@ -100,7 +100,7 @@ auto const InListConditionHelper = auto const MatchesConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::MatchesCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("string"_s, &cmCMakePresetsGraphInternal::MatchesCondition::String, ConditionStringHelper, true) @@ -112,10 +112,10 @@ bool SubConditionHelper(std::unique_ptr<cmCMakePresetsGraph::Condition>& out, auto const ListConditionVectorHelper = JSONHelperBuilder::Vector<std::unique_ptr<cmCMakePresetsGraph::Condition>>( - cmCMakePresetErrors::INVALID_CONDITION, SubConditionHelper); + cmCMakePresetsErrors::INVALID_CONDITION, SubConditionHelper); auto const AnyAllOfConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::AnyAllOfCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("conditions"_s, &cmCMakePresetsGraphInternal::AnyAllOfCondition::Conditions, @@ -123,7 +123,7 @@ auto const AnyAllOfConditionHelper = auto const NotConditionHelper = JSONHelperBuilder::Object<cmCMakePresetsGraphInternal::NotCondition>( - cmCMakePresetErrors::INVALID_CONDITION_OBJECT, false) + cmCMakePresetsErrors::INVALID_CONDITION_OBJECT, false) .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true) .Bind("condition"_s, &cmCMakePresetsGraphInternal::NotCondition::SubCondition, @@ -151,12 +151,12 @@ bool ConditionHelper(std::unique_ptr<cmCMakePresetsGraph::Condition>& out, if (value->isObject()) { if (!value->isMember("type")) { - cmCMakePresetErrors::INVALID_CONDITION(value, state); + cmCMakePresetsErrors::INVALID_CONDITION(value, state); return false; } if (!(*value)["type"].isString()) { - cmCMakePresetErrors::INVALID_CONDITION(value, state); + cmCMakePresetsErrors::INVALID_CONDITION(value, state); return false; } auto type = (*value)["type"].asString(); @@ -216,7 +216,7 @@ bool ConditionHelper(std::unique_ptr<cmCMakePresetsGraph::Condition>& out, } } - cmCMakePresetErrors::INVALID_CONDITION(value, state); + cmCMakePresetsErrors::INVALID_CONDITION(value, state); return false; } @@ -226,7 +226,7 @@ bool SubConditionHelper(std::unique_ptr<cmCMakePresetsGraph::Condition>& out, std::unique_ptr<cmCMakePresetsGraph::Condition> ptr; auto result = ConditionHelper(ptr, value, state); if (ptr && ptr->IsNull()) { - cmCMakePresetErrors::INVALID_CONDITION(value, state); + cmCMakePresetsErrors::INVALID_CONDITION(value, state); return false; } out = std::move(ptr); @@ -244,22 +244,22 @@ bool EnvironmentHelper(cm::optional<std::string>& out, out = value->asString(); return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } auto const VersionIntHelper = - JSONHelperBuilder::Int(cmCMakePresetErrors::INVALID_VERSION); + JSONHelperBuilder::Int(cmCMakePresetsErrors::INVALID_VERSION); auto const VersionHelper = JSONHelperBuilder::Required<int>( - cmCMakePresetErrors::NO_VERSION, VersionIntHelper); + cmCMakePresetsErrors::NO_VERSION, VersionIntHelper); auto const RootVersionHelper = - JSONHelperBuilder::Object<int>(cmCMakePresetErrors::INVALID_ROOT_OBJECT) + JSONHelperBuilder::Object<int>(cmCMakePresetsErrors::INVALID_ROOT_OBJECT) .Bind("version"_s, VersionHelper, false); auto const CMakeVersionUIntHelper = - JSONHelperBuilder::UInt(cmCMakePresetErrors::INVALID_VERSION); + JSONHelperBuilder::UInt(cmCMakePresetsErrors::INVALID_VERSION); auto const CMakeVersionHelper = JSONHelperBuilder::Object<CMakeVersion>(JsonErrors::INVALID_NAMED_OBJECT_KEY, @@ -269,14 +269,14 @@ auto const CMakeVersionHelper = .Bind("patch"_s, &CMakeVersion::Patch, CMakeVersionUIntHelper, false); auto const IncludeHelper = - JSONHelperBuilder::String(cmCMakePresetErrors::INVALID_INCLUDE); + JSONHelperBuilder::String(cmCMakePresetsErrors::INVALID_INCLUDE); auto const IncludeVectorHelper = JSONHelperBuilder::Vector<std::string>( - cmCMakePresetErrors::INVALID_INCLUDE, IncludeHelper); + cmCMakePresetsErrors::INVALID_INCLUDE, IncludeHelper); auto const RootPresetsHelper = JSONHelperBuilder::Object<RootPresets>( - cmCMakePresetErrors::INVALID_ROOT_OBJECT, false) + cmCMakePresetsErrors::INVALID_ROOT_OBJECT, false) .Bind<int>("version"_s, nullptr, VersionHelper) .Bind("configurePresets"_s, &RootPresets::ConfigurePresets, cmCMakePresetsGraphInternal::ConfigurePresetsHelper, false) @@ -293,7 +293,7 @@ auto const RootPresetsHelper = .Bind("include"_s, &RootPresets::Include, IncludeVectorHelper, false) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_ROOT), + cmCMakePresetsErrors::INVALID_ROOT), false); } @@ -309,7 +309,7 @@ bool PresetNameHelper(std::string& out, const Json::Value* value, cmJSONState* state) { if (!value || !value->isString() || value->asString().empty()) { - cmCMakePresetErrors::INVALID_PRESET_NAME(value, state); + cmCMakePresetsErrors::INVALID_PRESET_NAME(value, state); return false; } out = value->asString(); @@ -320,7 +320,7 @@ bool PresetVectorStringHelper(std::vector<std::string>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Vector<std::string>( - cmCMakePresetErrors::INVALID_PRESET, + cmCMakePresetsErrors::INVALID_PRESET, cmCMakePresetsGraphInternal::PresetStringHelper); return helper(out, value, state); } @@ -356,7 +356,7 @@ bool PresetVectorIntHelper(std::vector<int>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Vector<int>( - cmCMakePresetErrors::INVALID_PRESET, PresetIntHelper); + cmCMakePresetsErrors::INVALID_PRESET, PresetIntHelper); return helper(out, value, state); } @@ -409,7 +409,7 @@ bool EnvironmentMapHelper( const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Map<cm::optional<std::string>>( - cmCMakePresetErrors::INVALID_PRESET, EnvironmentHelper); + cmCMakePresetsErrors::INVALID_PRESET, EnvironmentHelper); return helper(out, value, state); } @@ -429,7 +429,7 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, auto fileIt = std::find(inProgressFiles.begin(), inProgressFiles.end(), file); if (fileIt != inProgressFiles.end()) { - cmCMakePresetErrors::CYCLIC_INCLUDE(filename, &this->parseState); + cmCMakePresetsErrors::CYCLIC_INCLUDE(filename, &this->parseState); return false; } @@ -448,43 +448,43 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, return result; } if (v < MIN_VERSION || v > MAX_VERSION) { - cmCMakePresetErrors::UNRECOGNIZED_VERSION(&root["version"], - &this->parseState); + cmCMakePresetsErrors::UNRECOGNIZED_VERSION(&root["version"], + &this->parseState); return false; } // Support for build and test presets added in version 2. if (v < 2) { if (root.isMember("buildPresets")) { - cmCMakePresetErrors::BUILD_TEST_PRESETS_UNSUPPORTED( + cmCMakePresetsErrors::BUILD_TEST_PRESETS_UNSUPPORTED( &root["buildPresets"], &this->parseState); return false; } if (root.isMember("testPresets")) { - cmCMakePresetErrors::BUILD_TEST_PRESETS_UNSUPPORTED(&root["testPresets"], - &this->parseState); + cmCMakePresetsErrors::BUILD_TEST_PRESETS_UNSUPPORTED( + &root["testPresets"], &this->parseState); return false; } } // Support for package presets added in version 6. if (v < 6 && root.isMember("packagePresets")) { - cmCMakePresetErrors::PACKAGE_PRESETS_UNSUPPORTED(&root["packagePresets"], - &this->parseState); + cmCMakePresetsErrors::PACKAGE_PRESETS_UNSUPPORTED(&root["packagePresets"], + &this->parseState); return false; } // Support for workflow presets added in version 6. if (v < 6 && root.isMember("workflowPresets")) { - cmCMakePresetErrors::WORKFLOW_PRESETS_UNSUPPORTED(&root["workflowPresets"], - &this->parseState); + cmCMakePresetsErrors::WORKFLOW_PRESETS_UNSUPPORTED( + &root["workflowPresets"], &this->parseState); return false; } // Support for include added in version 4. if (v < 4 && root.isMember("include")) { - cmCMakePresetErrors::INCLUDE_UNSUPPORTED(&root["include"], - &this->parseState); + cmCMakePresetsErrors::INCLUDE_UNSUPPORTED(&root["include"], + &this->parseState); return false; } @@ -498,20 +498,20 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, unsigned int currentPatch = cmVersion::GetPatchVersion(); auto const& required = presets.CMakeMinimumRequired; if (required.Major > currentMajor) { - ErrorGenerator error = cmCMakePresetErrors::UNRECOGNIZED_CMAKE_VERSION( + ErrorGenerator error = cmCMakePresetsErrors::UNRECOGNIZED_CMAKE_VERSION( "major", currentMajor, required.Major); error(&root["cmakeMinimumRequired"]["major"], &this->parseState); return false; } if (required.Major == currentMajor) { if (required.Minor > currentMinor) { - ErrorGenerator error = cmCMakePresetErrors::UNRECOGNIZED_CMAKE_VERSION( + ErrorGenerator error = cmCMakePresetsErrors::UNRECOGNIZED_CMAKE_VERSION( "minor", currentMinor, required.Minor); error(&root["cmakeMinimumRequired"]["minor"], &this->parseState); return false; } if (required.Minor == currentMinor && required.Patch > currentPatch) { - ErrorGenerator error = cmCMakePresetErrors::UNRECOGNIZED_CMAKE_VERSION( + ErrorGenerator error = cmCMakePresetsErrors::UNRECOGNIZED_CMAKE_VERSION( "patch", currentPatch, required.Patch); error(&root["cmakeMinimumRequired"]["patch"], &this->parseState); return false; @@ -537,26 +537,26 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, presetPair.Unexpanded = preset; presetPair.Expanded = cm::nullopt; if (!this->ConfigurePresets.emplace(preset.Name, presetPair).second) { - cmCMakePresetErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); + cmCMakePresetsErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); return false; } // Support for installDir presets added in version 3. if (v < 3 && !preset.InstallDir.empty()) { - cmCMakePresetErrors::INSTALL_PREFIX_UNSUPPORTED(&root["installDir"], - &this->parseState); + cmCMakePresetsErrors::INSTALL_PREFIX_UNSUPPORTED(&root["installDir"], + &this->parseState); return false; } // Support for conditions added in version 3. if (v < 3 && preset.ConditionEvaluator) { - cmCMakePresetErrors::CONDITION_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::CONDITION_UNSUPPORTED(&this->parseState); return false; } // Support for toolchainFile presets added in version 3. if (v < 3 && !preset.ToolchainFile.empty()) { - cmCMakePresetErrors::TOOLCHAIN_FILE_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::TOOLCHAIN_FILE_UNSUPPORTED(&this->parseState); return false; } @@ -564,7 +564,7 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, if (v < 7 && (preset.TraceMode.has_value() || preset.TraceFormat.has_value() || !preset.TraceRedirect.empty() || !preset.TraceSource.empty())) { - cmCMakePresetErrors::TRACE_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::TRACE_UNSUPPORTED(&this->parseState); return false; } @@ -582,13 +582,13 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, presetPair.Unexpanded = preset; presetPair.Expanded = cm::nullopt; if (!this->BuildPresets.emplace(preset.Name, presetPair).second) { - cmCMakePresetErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); + cmCMakePresetsErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); return false; } // Support for conditions added in version 3. if (v < 3 && preset.ConditionEvaluator) { - cmCMakePresetErrors::CONDITION_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::CONDITION_UNSUPPORTED(&this->parseState); return false; } @@ -606,26 +606,26 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, presetPair.Unexpanded = preset; presetPair.Expanded = cm::nullopt; if (!this->TestPresets.emplace(preset.Name, presetPair).second) { - cmCMakePresetErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); + cmCMakePresetsErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); return false; } // Support for conditions added in version 3. if (v < 3 && preset.ConditionEvaluator) { - cmCMakePresetErrors::CONDITION_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::CONDITION_UNSUPPORTED(&this->parseState); return false; } // Support for TestOutputTruncation added in version 5. if (v < 5 && preset.Output && preset.Output->TestOutputTruncation) { - cmCMakePresetErrors::TEST_OUTPUT_TRUNCATION_UNSUPPORTED( + cmCMakePresetsErrors::TEST_OUTPUT_TRUNCATION_UNSUPPORTED( &this->parseState); return false; } // Support for outputJUnitFile added in version 6. if (v < 6 && preset.Output && !preset.Output->OutputJUnitFile.empty()) { - cmCMakePresetErrors::CTEST_JUNIT_UNSUPPORTED(&this->parseState); + cmCMakePresetsErrors::CTEST_JUNIT_UNSUPPORTED(&this->parseState); return false; } @@ -643,7 +643,7 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, presetPair.Unexpanded = preset; presetPair.Expanded = cm::nullopt; if (!this->PackagePresets.emplace(preset.Name, presetPair).second) { - cmCMakePresetErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); + cmCMakePresetsErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); return false; } @@ -664,7 +664,7 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, presetPair.Unexpanded = preset; presetPair.Expanded = cm::nullopt; if (!this->WorkflowPresets.emplace(preset.Name, presetPair).second) { - cmCMakePresetErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); + cmCMakePresetsErrors::DUPLICATE_PRESETS(preset.Name, &this->parseState); return false; } @@ -718,8 +718,8 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename, // Support for macro expansion in includes added in version 7 if (v >= 7) { if (ExpandMacros(include, macroExpanders, v) != ExpandMacroResult::Ok) { - cmCMakePresetErrors::INVALID_INCLUDE(&root["include"][i], - &this->parseState); + cmCMakePresetsErrors::INVALID_INCLUDE(&root["include"][i], + &this->parseState); return false; } } diff --git a/Source/cmCMakePresetsGraphReadJSONBuildPresets.cxx b/Source/cmCMakePresetsGraphReadJSONBuildPresets.cxx index 07f2bc3..c743ac1 100644 --- a/Source/cmCMakePresetsGraphReadJSONBuildPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONBuildPresets.cxx @@ -13,7 +13,7 @@ #include <cm3p/json/value.h> #include "cmBuildOptions.h" -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -32,7 +32,7 @@ bool PackageResolveModeHelper(cm::optional<PackageResolveMode>& out, } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -43,7 +43,7 @@ bool PackageResolveModeHelper(cm::optional<PackageResolveMode>& out, } else if (value->asString() == "only") { out = PackageResolveMode::OnlyResolve; } else { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -59,7 +59,7 @@ std::function<bool(BuildPreset&, const Json::Value*, cmJSONState*)> const auto const BuildPresetHelper = JSONHelperBuilder::Object<BuildPreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("name"_s, &BuildPreset::Name, cmCMakePresetsGraphInternal::PresetNameHelper) .Bind("inherits"_s, &BuildPreset::Inherits, @@ -69,7 +69,7 @@ auto const BuildPresetHelper = cmCMakePresetsGraphInternal::PresetBoolHelper, false) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_PRESET), + cmCMakePresetsErrors::INVALID_PRESET), false) .Bind("displayName"_s, &BuildPreset::DisplayName, cmCMakePresetsGraphInternal::PresetStringHelper, false) @@ -105,7 +105,7 @@ bool BuildPresetsHelper(std::vector<BuildPreset>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Vector<BuildPreset>( - cmCMakePresetErrors::INVALID_PRESETS, BuildPresetHelper); + cmCMakePresetsErrors::INVALID_PRESETS, BuildPresetHelper); return helper(out, value, state); } diff --git a/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx b/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx index 3890cd0..c52a187 100644 --- a/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONConfigurePresets.cxx @@ -12,7 +12,7 @@ #include <cm3p/json/value.h> -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -37,7 +37,7 @@ bool ArchToolsetStrategyHelper(cm::optional<ArchToolsetStrategy>& out, } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -51,7 +51,7 @@ bool ArchToolsetStrategyHelper(cm::optional<ArchToolsetStrategy>& out, return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -85,7 +85,7 @@ ArchToolsetHelper( return objectHelper(out, value, state); } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; }; } @@ -104,7 +104,7 @@ bool TraceEnableModeHelper(cm::optional<TraceEnableMode>& out, } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -115,7 +115,7 @@ bool TraceEnableModeHelper(cm::optional<TraceEnableMode>& out, } else if (value->asString() == "expand") { out = TraceEnableMode::Expand; } else { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -131,7 +131,7 @@ bool TraceOutputFormatHelper(cm::optional<TraceOutputFormat>& out, } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -140,7 +140,7 @@ bool TraceOutputFormatHelper(cm::optional<TraceOutputFormat>& out, } else if (value->asString() == "json-v1") { out = TraceOutputFormat::JSONv1; } else { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -167,7 +167,7 @@ bool VariableValueHelper(std::string& out, const Json::Value* value, auto const VariableObjectHelper = JSONHelperBuilder::Object<CacheVariable>( - cmCMakePresetErrors::INVALID_VARIABLE_OBJECT, false) + cmCMakePresetsErrors::INVALID_VARIABLE_OBJECT, false) .Bind("type"_s, &CacheVariable::Type, VariableStringHelper, false) .Bind("value"_s, &CacheVariable::Value, VariableValueHelper); @@ -196,13 +196,13 @@ bool VariableHelper(cm::optional<CacheVariable>& out, const Json::Value* value, out = cm::nullopt; return true; } - cmCMakePresetErrors::INVALID_VARIABLE(value, state); + cmCMakePresetsErrors::INVALID_VARIABLE(value, state); return false; } auto const VariablesHelper = JSONHelperBuilder::Map<cm::optional<CacheVariable>>( - cmCMakePresetErrors::INVALID_PRESET, VariableHelper); + cmCMakePresetsErrors::INVALID_PRESET, VariableHelper); auto const PresetWarningsHelper = JSONHelperBuilder::Object<ConfigurePreset>( @@ -238,7 +238,7 @@ auto const PresetDebugHelper = auto const PresetTraceHelper = JSONHelperBuilder::Object<ConfigurePreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("mode"_s, &ConfigurePreset::TraceMode, TraceEnableModeHelper, false) .Bind("format"_s, &ConfigurePreset::TraceFormat, TraceOutputFormatHelper, false) @@ -250,7 +250,7 @@ auto const PresetTraceHelper = auto const ConfigurePresetHelper = JSONHelperBuilder::Object<ConfigurePreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("name"_s, &ConfigurePreset::Name, cmCMakePresetsGraphInternal::PresetNameHelper) .Bind("inherits"_s, &ConfigurePreset::Inherits, @@ -260,7 +260,7 @@ auto const ConfigurePresetHelper = cmCMakePresetsGraphInternal::PresetBoolHelper, false) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_PRESET), + cmCMakePresetsErrors::INVALID_PRESET), false) .Bind("displayName"_s, &ConfigurePreset::DisplayName, cmCMakePresetsGraphInternal::PresetStringHelper, false) @@ -295,7 +295,7 @@ bool ConfigurePresetsHelper(std::vector<ConfigurePreset>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Vector<ConfigurePreset>( - cmCMakePresetErrors::INVALID_PRESETS, ConfigurePresetHelper); + cmCMakePresetsErrors::INVALID_PRESETS, ConfigurePresetHelper); return helper(out, value, state); } diff --git a/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx b/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx index bbd77ba..ac49c62 100644 --- a/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx @@ -11,7 +11,7 @@ #include <cm3p/json/value.h> -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -29,14 +29,14 @@ auto const OutputHelper = cmCMakePresetsGraphInternal::PresetOptionalBoolHelper, false); auto const VariableHelper = - cmJSONHelperBuilder::String(cmCMakePresetErrors::INVALID_VARIABLE); + cmJSONHelperBuilder::String(cmCMakePresetsErrors::INVALID_VARIABLE); auto const VariablesHelper = cmJSONHelperBuilder::Map<std::string>( - cmCMakePresetErrors::INVALID_VARIABLE, VariableHelper); + cmCMakePresetsErrors::INVALID_VARIABLE, VariableHelper); auto const PackagePresetHelper = cmJSONHelperBuilder::Object<PackagePreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("name"_s, &PackagePreset::Name, cmCMakePresetsGraphInternal::PresetNameHelper) .Bind("inherits"_s, &PackagePreset::Inherits, @@ -46,7 +46,7 @@ auto const PackagePresetHelper = cmCMakePresetsGraphInternal::PresetBoolHelper, false) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_PRESET), + cmCMakePresetsErrors::INVALID_PRESET), false) .Bind("displayName"_s, &PackagePreset::DisplayName, cmCMakePresetsGraphInternal::PresetStringHelper, false) @@ -84,7 +84,7 @@ bool PackagePresetsHelper(std::vector<cmCMakePresetsGraph::PackagePreset>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = cmJSONHelperBuilder::Vector<PackagePreset>( - cmCMakePresetErrors::INVALID_PRESETS, PackagePresetHelper); + cmCMakePresetsErrors::INVALID_PRESETS, PackagePresetHelper); return helper(out, value, state); } diff --git a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx index a7c59fa..f9e0753 100644 --- a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx @@ -11,7 +11,7 @@ #include <cm3p/json/value.h> -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -34,7 +34,7 @@ bool TestPresetOutputVerbosityHelper( } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -53,7 +53,7 @@ bool TestPresetOutputVerbosityHelper( return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -71,7 +71,7 @@ bool TestPresetOutputTruncationHelper( } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -90,7 +90,7 @@ bool TestPresetOutputTruncationHelper( return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -201,7 +201,7 @@ bool TestPresetExecutionShowOnlyHelper( cmJSONState* state) { if (!value || !value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -215,7 +215,7 @@ bool TestPresetExecutionShowOnlyHelper( return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -232,7 +232,7 @@ bool TestPresetExecutionModeHelper( } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -251,7 +251,7 @@ bool TestPresetExecutionModeHelper( return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -273,7 +273,7 @@ bool TestPresetExecutionNoTestsActionHelper( } if (!value->isString()) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -292,7 +292,7 @@ bool TestPresetExecutionNoTestsActionHelper( return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -338,7 +338,7 @@ auto const TestPresetFilterHelper = auto const TestPresetHelper = JSONHelperBuilder::Object<TestPreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("name"_s, &TestPreset::Name, cmCMakePresetsGraphInternal::PresetNameHelper) .Bind("inherits"_s, &TestPreset::Inherits, @@ -348,7 +348,7 @@ auto const TestPresetHelper = cmCMakePresetsGraphInternal::PresetBoolHelper, false) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_PRESET), + cmCMakePresetsErrors::INVALID_PRESET), false) .Bind("displayName"_s, &TestPreset::DisplayName, cmCMakePresetsGraphInternal::PresetStringHelper, false) @@ -380,7 +380,7 @@ bool TestPresetsHelper(std::vector<cmCMakePresetsGraph::TestPreset>& out, const Json::Value* value, cmJSONState* state) { static auto const helper = JSONHelperBuilder::Vector<TestPreset>( - cmCMakePresetErrors::INVALID_PRESETS, TestPresetHelper); + cmCMakePresetsErrors::INVALID_PRESETS, TestPresetHelper); return helper(out, value, state); } diff --git a/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx b/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx index f596d6c..e152871 100644 --- a/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx @@ -8,7 +8,7 @@ #include <cm3p/json/value.h> -#include "cmCMakePresetErrors.h" +#include "cmCMakePresetsErrors.h" #include "cmCMakePresetsGraph.h" #include "cmCMakePresetsGraphInternal.h" #include "cmJSONHelpers.h" @@ -22,7 +22,7 @@ bool WorkflowStepTypeHelper(WorkflowPreset::WorkflowStep::Type& out, const Json::Value* value, cmJSONState* state) { if (!value) { - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -50,7 +50,7 @@ bool WorkflowStepTypeHelper(WorkflowPreset::WorkflowStep::Type& out, return true; } - cmCMakePresetErrors::INVALID_PRESET(value, state); + cmCMakePresetsErrors::INVALID_PRESET(value, state); return false; } @@ -64,16 +64,16 @@ auto const WorkflowStepHelper = auto const WorkflowStepsHelper = cmJSONHelperBuilder::Vector<WorkflowPreset::WorkflowStep>( - cmCMakePresetErrors::INVALID_PRESET, WorkflowStepHelper); + cmCMakePresetsErrors::INVALID_PRESET, WorkflowStepHelper); auto const WorkflowPresetHelper = cmJSONHelperBuilder::Object<WorkflowPreset>( - cmCMakePresetErrors::INVALID_PRESET_OBJECT, false) + cmCMakePresetsErrors::INVALID_PRESET_OBJECT, false) .Bind("name"_s, &WorkflowPreset::Name, cmCMakePresetsGraphInternal::PresetNameHelper) .Bind<std::nullptr_t>("vendor"_s, nullptr, cmCMakePresetsGraphInternal::VendorHelper( - cmCMakePresetErrors::INVALID_PRESET), + cmCMakePresetsErrors::INVALID_PRESET), false) .Bind("displayName"_s, &WorkflowPreset::DisplayName, cmCMakePresetsGraphInternal::PresetStringHelper, false) @@ -88,7 +88,7 @@ bool WorkflowPresetsHelper( const Json::Value* value, cmJSONState* state) { static auto const helper = cmJSONHelperBuilder::Vector<WorkflowPreset>( - cmCMakePresetErrors::INVALID_PRESETS, WorkflowPresetHelper); + cmCMakePresetsErrors::INVALID_PRESETS, WorkflowPresetHelper); return helper(out, value, state); } |