Commit ef494edf authored by Bekenn's avatar Bekenn Committed by Brad King
Browse files

Xcode: Don't emit empty settings blocks.

parent 82ebbf68
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment