cmake: Clarify name of role of internal instances

These instances do not run arbitrary cmake language code.
This commit is contained in:
Brad King
2025-10-20 17:03:48 -04:00
parent 57ea73f289
commit 0b83750e14
7 changed files with 12 additions and 12 deletions

View File

@@ -2200,7 +2200,7 @@ bool cmCTestTestHandler::SetTestsProperties(
// Ensure we have complete triples otherwise the data is corrupt.
if (triples.size() % 3 == 0) {
cmState state(cmState::Role::Unknown);
cmState state(cmState::Role::Internal);
rt.Backtrace = cmListFileBacktrace();
// the first entry represents the top of the trace so we need to

View File

@@ -3049,7 +3049,7 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
auto export_info = cmDyndepCollation::ParseExportInfo(tdi);
cmake cm(cmake::CommandSet::None, cmState::Role::Unknown);
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
cm.SetHomeDirectory(dir_top_src);
cm.SetHomeOutputDirectory(dir_top_bld);
auto ggd = cm.CreateGlobalGenerator("Ninja");

View File

@@ -837,8 +837,8 @@ std::string cmState::RoleToString(cmState::Role mode)
return "CPACK";
case Role::Help:
return "HELP";
case Role::Unknown:
return "UNKNOWN";
case Role::Internal:
return "INTERNAL";
}
return "UNKNOWN";
}

View File

@@ -46,13 +46,13 @@ class cmState
public:
enum class Role
{
Unknown,
Internal,
Project,
Script,
FindPackage,
CTest,
CPack,
Help
Help,
};
enum class TryCompile
@@ -304,7 +304,7 @@ private:
bool Ninja = false;
bool NinjaMulti = false;
bool FastbuildMake = false;
Role StateRole = Role::Unknown;
Role StateRole = Role::Internal;
TryCompile IsTryCompile = TryCompile::No;
cm::optional<cmDependencyProvider> DependencyProvider;
bool ProcessingTopLevelIncludes = false;

View File

@@ -366,7 +366,7 @@ int do_cmake(int ac, char const* const* av)
cmake::CommandSet const commandSet = workingMode == cmake::SCRIPT_MODE
? cmake::CommandSet::Script
: cmake::CommandSet::Project;
cmState::Role role = cmState::Role::Unknown;
cmState::Role role = cmState::Role::Internal;
switch (workingMode) {
case cmake::NORMAL_MODE:
case cmake::HELP_MODE:
@@ -1109,7 +1109,7 @@ int do_open(int ac, char const* const* av)
return 1;
}
cmake cm(cmake::CommandSet::None, cmState::Role::Unknown);
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
cmSystemTools::SetMessageCallback(
[&cm](std::string const& msg, cmMessageMetadata const& md) {
cmakemainMessageCallback(msg, md, &cm);

View File

@@ -1150,7 +1150,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
std::cerr << "-E capabilities accepts no additional arguments\n";
return 1;
}
cmake cm(cmake::CommandSet::None, cmState::Role::Unknown);
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
std::cout << cm.ReportCapabilities();
return 0;
}

View File

@@ -501,7 +501,7 @@ static bool testCreateFromFileSet()
auto variablesManager =
std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
cmake cm(cmake::CommandSet::Script, cmState::Role::Unknown);
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
cmFileSet fileSet(cm, "Foo", "HEADERS", cmFileSetVisibility::Public);
BT<std::string> directory;
directory.Value = "c:/";
@@ -545,7 +545,7 @@ static bool testCreateFromFileSets()
auto variablesManager =
std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
cmake cm(cmake::CommandSet::Script, cmState::Role::Unknown);
cmake cm(cmake::CommandSet::None, cmState::Role::Internal);
cmFileSet fileSet(cm, "Foo", "HEADERS", cmFileSetVisibility::Public);
BT<std::string> directory;
directory.Value = "c:/";