summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorJames Touton <bekenn@gmail.com>2016-06-04 01:32:38 (GMT)
committerBrad King <brad.king@kitware.com>2016-06-17 14:49:06 (GMT)
commitef494edf766d622f87b82e601bf6ef7405bf29d0 (patch)
tree733fb92ed6d1c6a364f76acfb3953a1f5ab554d2 /Source/cmGlobalXCodeGenerator.cxx
parent82ebbf683e201af7b9bb493a221804992abf5a4a (diff)
downloadCMake-ef494edf766d622f87b82e601bf6ef7405bf29d0.zip
CMake-ef494edf766d622f87b82e601bf6ef7405bf29d0.tar.gz
CMake-ef494edf766d622f87b82e601bf6ef7405bf29d0.tar.bz2
Xcode: Don't emit empty settings blocks.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 4d778ee..b439018 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -689,7 +689,8 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
cmXCodeObject* fileRef = buildFile->GetObject("fileRef")->GetObject();
cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
- settings->AddAttribute("COMPILER_FLAGS", this->CreateString(flags));
+ settings->AddAttributeIfNotEmpty("COMPILER_FLAGS",
+ this->CreateString(flags));
// Is this a resource file in this target? Add it to the resources group...
//
@@ -698,23 +699,23 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
gtgt->GetTargetSourceFileFlags(sf);
bool isResource = tsFlags.Type == cmGeneratorTarget::SourceFileTypeResource;
+ cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+
// Is this a "private" or "public" framework header file?
// Set the ATTRIBUTES attribute appropriately...
//
if (gtgt->IsFrameworkOnApple()) {
if (tsFlags.Type == cmGeneratorTarget::SourceFileTypePrivateHeader) {
- cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
attrs->AddObject(this->CreateString("Private"));
- settings->AddAttribute("ATTRIBUTES", attrs);
isResource = true;
} else if (tsFlags.Type == cmGeneratorTarget::SourceFileTypePublicHeader) {
- cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
attrs->AddObject(this->CreateString("Public"));
- settings->AddAttribute("ATTRIBUTES", attrs);
isResource = true;
}
}
+ settings->AddAttributeIfNotEmpty("ATTRIBUTES", attrs);
+
// Add the fileRef to the top level Resources group/folder if it is not
// already there.
//
@@ -723,7 +724,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
this->ResourcesGroupChildren->AddObject(fileRef);
}
- buildFile->AddAttribute("settings", settings);
+ buildFile->AddAttributeIfNotEmpty("settings", settings);
return buildFile;
}