1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 05:26:58 +08:00

cmLocalGenerator: get the configuration when building object paths

Install locations can be per-configuration, so this information is
necessary for this call. Plumb it through; usage will follow in the next
commit.
This commit is contained in:
Ben Boeckel
2025-09-05 23:52:15 -04:00
parent 168e55be41
commit 08f1a0fbc6
15 changed files with 16 additions and 15 deletions

View File

@@ -570,7 +570,7 @@ void cmFastbuildNormalTargetGenerator::GenerateModuleDefinitionInfo(
for (cmSourceFile const* it : objectSources) {
mapping[it];
}
GeneratorTarget->LocalGenerator->ComputeObjectFilenames(mapping,
GeneratorTarget->LocalGenerator->ComputeObjectFilenames(mapping, Config,
GeneratorTarget);
std::vector<std::string> objs;

View File

@@ -698,7 +698,7 @@ void cmGeneratorTarget::GetObjectSources(
this->Objects[it];
}
this->LocalGenerator->ComputeObjectFilenames(this->Objects, this);
this->LocalGenerator->ComputeObjectFilenames(this->Objects, config, this);
this->VisitedConfigsForObjects.insert(config);
}
@@ -4043,7 +4043,7 @@ void cmGeneratorTarget::GetTargetObjectLocations(
mapping[sf];
}
this->LocalGenerator->ComputeObjectFilenames(mapping, this);
this->LocalGenerator->ComputeObjectFilenames(mapping, config, this);
auto const buildUseShortPaths = this->GetUseShortObjectNames()
? cmObjectLocations::UseShortPath::Yes

View File

@@ -723,7 +723,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
for (cmSourceFile const* it : objectSources) {
mapping[it];
}
gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
gt->LocalGenerator->ComputeObjectFilenames(mapping, configName, gt);
std::string obj_dir = gt->ObjectDirectory;
std::string cmakeCommand = cmSystemTools::GetCMakeCommand();
std::string obj_dir_expanded = obj_dir;

View File

@@ -116,7 +116,7 @@ std::string cmLocalCommonGenerator::GetTargetDirectory(
void cmLocalCommonGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt)
std::string const& config, cmGeneratorTarget const* gt)
{
// Determine if these object files should use a custom extension
char const* custom_ext = gt->GetCustomObjectExtension();

View File

@@ -45,7 +45,7 @@ public:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt = nullptr) override;
std::string const& config, cmGeneratorTarget const* gt = nullptr) override;
protected:
std::vector<std::string> ConfigNames;

View File

@@ -60,7 +60,7 @@ cmLocalFastbuildGenerator::GetGlobalFastbuildGenerator()
void cmLocalFastbuildGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt)
std::string const& config, cmGeneratorTarget const* gt)
{
for (auto& si : mapping) {
cmSourceFile const* sf = si.first;

View File

@@ -26,7 +26,7 @@ public:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt = nullptr) override;
std::string const& config, cmGeneratorTarget const* gt = nullptr) override;
cmGlobalFastbuildGenerator const* GetGlobalFastbuildGenerator() const;
cmGlobalFastbuildGenerator* GetGlobalFastbuildGenerator();

View File

@@ -4157,7 +4157,7 @@ std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName(
void cmLocalGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& /*unused*/,
cmGeneratorTarget const* /*unused*/)
std::string const& /*unused*/, cmGeneratorTarget const* /*unused*/)
{
}

View File

@@ -529,7 +529,7 @@ public:
virtual void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt = nullptr);
std::string const& config, cmGeneratorTarget const* gt = nullptr);
bool IsWindowsShell() const;
bool IsWatcomWMake() const;

View File

@@ -50,7 +50,7 @@ void cmLocalGhsMultiGenerator::Generate()
void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt)
std::string const& config, cmGeneratorTarget const* gt)
{
std::string dir_max = cmStrCat(gt->GetSupportDirectory(), '/');

View File

@@ -40,5 +40,5 @@ public:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt = nullptr) override;
std::string const& config, cmGeneratorTarget const* gt = nullptr) override;
};

View File

@@ -40,7 +40,7 @@ cmLocalVisualStudioGenerator::GetVersion() const
void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt)
std::string const& config, cmGeneratorTarget const* gt)
{
char const* custom_ext = gt->GetCustomObjectExtension();
std::string dir_max = this->ComputeLongestObjectDirectory(gt);

View File

@@ -51,7 +51,7 @@ public:
void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* = nullptr) override;
std::string const& config, cmGeneratorTarget const* = nullptr) override;
std::string GetObjectOutputRoot(
cmStateEnums::IntermediateDirKind kind =

View File

@@ -121,6 +121,7 @@ void cmLocalXCodeGenerator::AddGeneratorSpecificInstallSetup(std::ostream& os)
void cmLocalXCodeGenerator::ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
std::string const& config,
cmGeneratorTarget const*)
{
// Count the number of object files with each name. Warn about duplicate

View File

@@ -38,7 +38,7 @@ public:
void AddGeneratorSpecificInstallSetup(std::ostream& os) override;
void ComputeObjectFilenames(
std::map<cmSourceFile const*, cmObjectLocations>& mapping,
cmGeneratorTarget const* gt = nullptr) override;
std::string const& config, cmGeneratorTarget const* gt = nullptr) override;
void AddXCConfigSources(cmGeneratorTarget* target) override;