mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
presets: Identify unreachable inherited presets
This commit is contained in:
@@ -123,11 +123,14 @@ void CYCLIC_PRESET_INHERITANCE(std::string const& presetName,
|
||||
}
|
||||
|
||||
void INHERITED_PRESET_UNREACHABLE_FROM_FILE(std::string const& presetName,
|
||||
std::string const& inheritedPreset,
|
||||
std::string const& kind,
|
||||
cmJSONState* state)
|
||||
{
|
||||
state->AddError(cmStrCat("Inherited ", kind, " preset \"", presetName,
|
||||
"\" is unreachable from preset's file"));
|
||||
state->AddError(cmStrCat(CapitalizePresetKind(kind), " preset \"",
|
||||
presetName, "\" inherits preset \"",
|
||||
inheritedPreset, "\", but \"", inheritedPreset,
|
||||
"\" is not reachable from the preset's file"));
|
||||
}
|
||||
|
||||
void CONFIGURE_PRESET_UNREACHABLE_FROM_FILE(std::string const& presetName,
|
||||
|
||||
@@ -47,6 +47,7 @@ void CYCLIC_PRESET_INHERITANCE(std::string const& presetName,
|
||||
std::string const& kind, cmJSONState* state);
|
||||
|
||||
void INHERITED_PRESET_UNREACHABLE_FROM_FILE(std::string const& presetName,
|
||||
std::string const& inheritedPreset,
|
||||
std::string const& kind,
|
||||
cmJSONState* state);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ bool VisitPreset(
|
||||
auto& parentPreset = parent->second.Unexpanded;
|
||||
if (!preset.OriginFile->ReachableFiles.count(parentPreset.OriginFile)) {
|
||||
cmCMakePresetsErrors::INHERITED_PRESET_UNREACHABLE_FROM_FILE(
|
||||
preset.Name, preset.kind(), &graph.parseState);
|
||||
preset.Name, i, preset.kind(), &graph.parseState);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
^CMake Error: Could not read presets from [^
|
||||
]*/Tests/RunCMake/CMakePresets/UserInheritance:
|
||||
Inherited configure preset "UserInheritance" is unreachable from preset's file$
|
||||
Configure preset "UserInheritance" inherits preset "UserInheritanceUser", but "UserInheritanceUser" is not reachable from the preset's file$
|
||||
|
||||
Reference in New Issue
Block a user