瀏覽代碼

VS: Port ComputeLongestObjectDirectory to cmGeneratorTarget

Stephen Kelly 10 年之前
父節點
當前提交
26e23e8463

+ 1 - 1
Source/cmLocalVisualStudio6Generator.cxx

@@ -1935,7 +1935,7 @@ cmLocalVisualStudio6Generator
 //----------------------------------------------------------------------------
 std::string
 cmLocalVisualStudio6Generator
-::ComputeLongestObjectDirectory(cmTarget&) const
+::ComputeLongestObjectDirectory(cmGeneratorTarget const*) const
 {
   // Compute the maximum length configuration name.
   std::string config_max;

+ 2 - 1
Source/cmLocalVisualStudio6Generator.h

@@ -50,7 +50,8 @@ public:
 
   virtual
   std::string GetTargetDirectory(cmGeneratorTarget const* target) const;
-  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
+  virtual std::string
+  ComputeLongestObjectDirectory(cmGeneratorTarget const*) const;
 private:
   std::string DSPHeaderTemplate;
   std::string DSPFooterTemplate;

+ 3 - 5
Source/cmLocalVisualStudio7Generator.cxx

@@ -1689,10 +1689,10 @@ cmLocalVisualStudio7GeneratorFCInfo
 //----------------------------------------------------------------------------
 std::string
 cmLocalVisualStudio7Generator
-::ComputeLongestObjectDirectory(cmTarget& target) const
+::ComputeLongestObjectDirectory(cmGeneratorTarget const* target) const
 {
   std::vector<std::string> configs;
-  target.GetMakefile()->GetConfigurations(configs);
+  target->Target->GetMakefile()->GetConfigurations(configs);
 
   // Compute the maximum length configuration name.
   std::string config_max;
@@ -1711,9 +1711,7 @@ cmLocalVisualStudio7Generator
   std::string dir_max;
   dir_max += this->GetCurrentBinaryDirectory();
   dir_max += "/";
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
-  dir_max += this->GetTargetDirectory(gt);
+  dir_max += this->GetTargetDirectory(target);
   dir_max += "/";
   dir_max += config_max;
   dir_max += "/";

+ 2 - 1
Source/cmLocalVisualStudio7Generator.h

@@ -56,7 +56,8 @@ public:
   std::string GetTargetDirectory(cmGeneratorTarget const* target) const;
   cmSourceFile* CreateVCProjBuildRule();
   void WriteStampFiles();
-  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
+  virtual std::string
+  ComputeLongestObjectDirectory(cmGeneratorTarget const*) const;
 
   virtual void ReadAndStoreExternalGUID(const std::string& name,
                                         const char* path);

+ 1 - 1
Source/cmLocalVisualStudioGenerator.cxx

@@ -43,7 +43,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
                         std::map<cmSourceFile const*, std::string>& mapping,
                         cmGeneratorTarget const* gt)
 {
-  std::string dir_max = this->ComputeLongestObjectDirectory(*gt->Target);
+  std::string dir_max = this->ComputeLongestObjectDirectory(gt);
 
   // Count the number of object files with each name.  Note that
   // windows file names are not case sensitive.

+ 2 - 1
Source/cmLocalVisualStudioGenerator.h

@@ -44,7 +44,8 @@ public:
 
   cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
 
-  virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
+  virtual std::string
+  ComputeLongestObjectDirectory(cmGeneratorTarget const*) const = 0;
 
   virtual void AddCMakeListsRules() = 0;