Ver Fonte

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.
Ben Boeckel há 1 mês atrás
pai
commit
08f1a0fbc6

+ 1 - 1
Source/cmFastbuildNormalTargetGenerator.cxx

@@ -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;

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -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

+ 1 - 1
Source/cmGlobalVisualStudioGenerator.cxx

@@ -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;

+ 1 - 1
Source/cmLocalCommonGenerator.cxx

@@ -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();

+ 1 - 1
Source/cmLocalCommonGenerator.h

@@ -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;

+ 1 - 1
Source/cmLocalFastbuildGenerator.cxx

@@ -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;

+ 1 - 1
Source/cmLocalFastbuildGenerator.h

@@ -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();

+ 1 - 1
Source/cmLocalGenerator.cxx

@@ -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*/)
 {
 }
 

+ 1 - 1
Source/cmLocalGenerator.h

@@ -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;

+ 1 - 1
Source/cmLocalGhsMultiGenerator.cxx

@@ -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(), '/');
 

+ 1 - 1
Source/cmLocalGhsMultiGenerator.h

@@ -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;
 };

+ 1 - 1
Source/cmLocalVisualStudioGenerator.cxx

@@ -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);

+ 1 - 1
Source/cmLocalVisualStudioGenerator.h

@@ -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 =

+ 1 - 0
Source/cmLocalXCodeGenerator.cxx

@@ -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

+ 1 - 1
Source/cmLocalXCodeGenerator.h

@@ -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;