export: Fix const placement

Use clang-format to fix placement of const qualifiers to be consistently
right of the typename. The inconsistency was getting annoying,
especially as the following refactor changes a lot of methods and
sometimes adds const. (Being inconsistent within a file is not ideal,
but in some cases there was inconsistency within single lines!)
This commit is contained in:
Matthew Woehlke
2024-07-08 13:27:51 -04:00
parent 1bceab3520
commit 6c66340a64
20 changed files with 237 additions and 237 deletions
+11 -11
View File
@@ -144,7 +144,7 @@ bool cmExportBuildCMakeConfigGenerator::GenerateMainFile(std::ostream& os)
return false;
}
const bool newCMP0022Behavior =
bool const newCMP0022Behavior =
gte->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
gte->GetPolicyStatusCMP0022() != cmPolicies::OLD;
if (newCMP0022Behavior) {
@@ -190,7 +190,7 @@ bool cmExportBuildCMakeConfigGenerator::GenerateMainFile(std::ostream& os)
}
void cmExportBuildCMakeConfigGenerator::GenerateImportTargetsConfig(
std::ostream& os, const std::string& config, std::string const& suffix)
std::ostream& os, std::string const& config, std::string const& suffix)
{
for (auto const& exp : this->Exports) {
cmGeneratorTarget* target = exp.Target;
@@ -261,7 +261,7 @@ void cmExportBuildCMakeConfigGenerator::SetExportSet(cmExportSet* exportSet)
}
void cmExportBuildCMakeConfigGenerator::SetImportLocationProperty(
const std::string& config, std::string const& suffix,
std::string const& config, std::string const& suffix,
cmGeneratorTarget* target, ImportPropertyMap& properties)
{
// Get the makefile in which to lookup target information.
@@ -277,7 +277,7 @@ void cmExportBuildCMakeConfigGenerator::SetImportLocationProperty(
std::string const obj_dir = target->GetObjectDirectory(config);
std::vector<std::string> objects;
for (cmSourceFile const* sf : objectSources) {
const std::string& obj = target->GetObjectName(sf);
std::string const& obj = target->GetObjectName(sf);
objects.push_back(obj_dir + obj);
}
@@ -318,7 +318,7 @@ void cmExportBuildCMakeConfigGenerator::HandleMissingTarget(
{
// The target is not in the export.
if (!this->AppendMode) {
const std::string name = dependee->GetName();
std::string const name = dependee->GetName();
cmGlobalGenerator* gg =
dependee->GetLocalGenerator()->GetGlobalGenerator();
auto exportInfo = this->FindBuildExportInfo(gg, name);
@@ -360,7 +360,7 @@ void cmExportBuildCMakeConfigGenerator::GetTargets(
std::pair<std::vector<std::string>, std::string>
cmExportBuildCMakeConfigGenerator::FindBuildExportInfo(cmGlobalGenerator* gg,
const std::string& name)
std::string const& name)
{
std::vector<std::string> exportFiles;
std::string ns;
@@ -368,12 +368,12 @@ cmExportBuildCMakeConfigGenerator::FindBuildExportInfo(cmGlobalGenerator* gg,
auto& exportSets = gg->GetBuildExportSets();
for (auto const& exp : exportSets) {
const auto& exportSet = exp.second;
auto const& exportSet = exp.second;
std::vector<TargetExport> targets;
exportSet->GetTargets(targets);
if (std::any_of(
targets.begin(), targets.end(),
[&name](const TargetExport& te) { return te.Name == name; })) {
[&name](TargetExport const& te) { return te.Name == name; })) {
exportFiles.push_back(exp.first);
ns = exportSet->GetNamespace();
}
@@ -406,7 +406,7 @@ void cmExportBuildCMakeConfigGenerator::ComplainAboutMissingTarget(
}
std::string cmExportBuildCMakeConfigGenerator::InstallNameDir(
cmGeneratorTarget const* target, const std::string& config)
cmGeneratorTarget const* target, std::string const& config)
{
std::string install_name_dir;
@@ -420,7 +420,7 @@ std::string cmExportBuildCMakeConfigGenerator::InstallNameDir(
namespace {
bool EntryIsContextSensitive(
const std::unique_ptr<cmCompiledGeneratorExpression>& cge)
std::unique_ptr<cmCompiledGeneratorExpression> const& cge)
{
return cge->GetHadContextSensitiveCondition();
}
@@ -544,7 +544,7 @@ std::string cmExportBuildCMakeConfigGenerator::GetCxxModulesDirectory() const
void cmExportBuildCMakeConfigGenerator::GenerateCxxModuleConfigInformation(
std::string const& name, std::ostream& os) const
{
const char* opt = "";
char const* opt = "";
if (this->Configurations.size() > 1) {
// With more than one configuration, each individual file is optional.
opt = " OPTIONAL";