Experimental: Avoid mutating statically allocated data

This commit is contained in:
Brad King
2025-05-13 10:09:06 -04:00
parent 348ba701fe
commit b05e5403d9
4 changed files with 39 additions and 31 deletions
+9
View File
@@ -2003,6 +2003,7 @@ void cmGlobalGenerator::ClearGeneratorMembers()
this->GeneratedFiles.clear();
this->RuntimeDependencySets.clear();
this->RuntimeDependencySetsByName.clear();
this->WarnedExperimental.clear();
}
void cmGlobalGenerator::ComputeTargetObjectDirectory(
@@ -3914,3 +3915,11 @@ void cmGlobalGenerator::AddCMakeFilesToRebuild(
this->InstallScripts.end());
files.insert(files.end(), this->TestFiles.begin(), this->TestFiles.end());
}
bool cmGlobalGenerator::ShouldWarnExperimental(cm::string_view featureName,
cm::string_view featureUuid)
{
return this->WarnedExperimental
.emplace(cmStrCat(featureName, '-', featureUuid))
.second;
}