summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-02-07 22:36:34 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-02-07 22:36:34 (GMT)
commit0bc51d181d62ae64c69d09aaf748aeee904645c8 (patch)
tree71d40ccad111da1386ba426f40399896da7af84f /Source/cmGlobalXCodeGenerator.cxx
parent16b9edd17b89209b4a71804e252bfd5613d224e5 (diff)
downloadCMake-0bc51d181d62ae64c69d09aaf748aeee904645c8.zip
CMake-0bc51d181d62ae64c69d09aaf748aeee904645c8.tar.gz
CMake-0bc51d181d62ae64c69d09aaf748aeee904645c8.tar.bz2
ENH: fix bug in target linking
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 1f579f8..d587f89 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -29,6 +29,7 @@
// do I need an ALL_BUILD
// link libraries stuff
// exe/lib output paths
+// PBXBuildFile can not be reused, or error occurs
//----------------------------------------------------------------------------
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator()
@@ -443,14 +444,18 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
target->AddAttribute("dependencies", dependencies);
target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
+
cmXCodeObject* fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
fileRef->AddAttribute("explicitFileType",
this->CreateString(fileTypeString.c_str()));
- fileRef->AddAttribute("includedInIndex", this->CreateString("0"));
+// fileRef->AddAttribute("includedInIndex", this->CreateString("0"));
fileRef->AddAttribute("path", this->CreateString(productName.c_str()));
fileRef->AddAttribute("refType", this->CreateString("3"));
- fileRef->AddAttribute("sourceTree", this->CreateString("BUILT_PRODUCTS_DIR"));
- target->AddAttribute("productReference", this->CreateObjectReference(fileRef));
+ fileRef->AddAttribute("sourceTree",
+ this->CreateString("BUILT_PRODUCTS_DIR"));
+
+ target->AddAttribute("productReference",
+ this->CreateObjectReference(fileRef));
target->AddAttribute("productType",
this->CreateString(productTypeString.c_str()));
target->SetcmTarget(&cmtarget);
@@ -515,8 +520,9 @@ void cmGlobalXCodeGenerator::AddDependTarget(cmXCodeObject* target,
void cmGlobalXCodeGenerator::AddLinkTarget(cmXCodeObject* target ,
cmXCodeObject* dependTarget )
{
- cmXCodeObject* buildfile = this->CreateObject(cmXCodeObject::PBXBuildFile);
cmXCodeObject* ref = dependTarget->GetObject("productReference");
+
+ cmXCodeObject* buildfile = this->CreateObject(cmXCodeObject::PBXBuildFile);
buildfile->AddAttribute("fileRef", ref);
cmXCodeObject* settings =
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
@@ -553,7 +559,10 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
if(dptarget)
{
this->AddDependTarget(target, dptarget);
- this->AddLinkTarget(target, dptarget);
+ if(cmtarget->GetType() != cmTarget::STATIC_LIBRARY)
+ {
+ this->AddLinkTarget(target, dptarget);
+ }
}
else
{
@@ -654,7 +663,7 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* ,
cmXCodeObject* productRef = t->GetObject("productReference");
if(productRef)
{
- productGroupChildren->AddObject(productRef);
+ productGroupChildren->AddObject(productRef->GetObject());
}
}
m_RootObject->AddAttribute("targets", allTargets);