浏览代码

Xcode: Re-factor code into GetObjectsNormalDirectory method

...in preparation for calling it from more than one location.
Required to support OBJECT_LIBRARY targets in Xcode.
David Cole 13 年之前
父节点
当前提交
34e4985eed
共有 2 个文件被更改,包括 27 次插入9 次删除
  1. 22 9
      Source/cmGlobalXCodeGenerator.cxx
  2. 5 0
      Source/cmGlobalXCodeGenerator.h

+ 22 - 9
Source/cmGlobalXCodeGenerator.cxx

@@ -3045,6 +3045,26 @@ void cmGlobalXCodeGenerator
   this->RootObject->AddAttribute("targets", allTargets);
 }
 
+//----------------------------------------------------------------------------
+std::string
+cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
+  const std::string &projName,
+  const std::string &configName,
+  const cmTarget *t) const
+{
+  std::string dir =
+    t->GetMakefile()->GetCurrentOutputDirectory();
+  dir += "/";
+  dir += projName;
+  dir += ".build/";
+  dir += configName;
+  dir += "/";
+  dir += t->GetName();
+  dir += ".build/Objects-normal/";
+
+  return dir;
+}
+
 //----------------------------------------------------------------------------
 void
 cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
@@ -3169,15 +3189,8 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         // then remove those exectuables as well
         if(this->Architectures.size() > 1)
           {
-          std::string universal =
-            t->GetMakefile()->GetCurrentOutputDirectory();
-          universal += "/";
-          universal += this->CurrentProject;
-          universal += ".build/";
-          universal += configName;
-          universal += "/";
-          universal += t->GetName();
-          universal += ".build/Objects-normal/";
+          std::string universal = this->GetObjectsNormalDirectory(
+            this->CurrentProject, configName, t);
           for( std::vector<std::string>::iterator arch =
                  this->Architectures.begin();
                arch != this->Architectures.end(); ++arch)

+ 5 - 0
Source/cmGlobalXCodeGenerator.h

@@ -200,6 +200,11 @@ protected:
   std::vector<cmXCodeObject*> XCodeObjects;
   cmXCodeObject* RootObject;
 private:
+  std::string GetObjectsNormalDirectory(
+    const std::string &projName,
+    const std::string &configName,
+    const cmTarget *t) const;
+
   void addObject(cmXCodeObject *obj);
   std::string PostBuildMakeTarget(std::string const& tName,
                                   std::string const& configName);