summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-17 13:20:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-18 14:29:30 (GMT)
commita527abf0995fc1bdd45afdb20e80b728dd0ef045 (patch)
treefee6461eb967190361b9e544c1da21d495f43460 /Source
parenteb3be7d68851ce87354f6bd90e0be3a670d22d56 (diff)
downloadCMake-a527abf0995fc1bdd45afdb20e80b728dd0ef045.zip
CMake-a527abf0995fc1bdd45afdb20e80b728dd0ef045.tar.gz
CMake-a527abf0995fc1bdd45afdb20e80b728dd0ef045.tar.bz2
Xcode: Port internal API to cmGeneratorTarget.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx31
-rw-r--r--Source/cmGlobalXCodeGenerator.h4
2 files changed, 19 insertions, 16 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index fec7a05..faaf823 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2639,23 +2639,24 @@ cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
}
//----------------------------------------------------------------------------
-const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
+const char* cmGlobalXCodeGenerator::GetTargetFileType(
+ cmGeneratorTarget* target)
{
- switch(cmtarget.GetType())
+ switch(target->GetType())
{
case cmState::OBJECT_LIBRARY:
case cmState::STATIC_LIBRARY:
return "archive.ar";
case cmState::MODULE_LIBRARY:
- if (cmtarget.IsXCTestOnApple())
+ if (target->Target->IsXCTestOnApple())
return "wrapper.cfbundle";
- else if (cmtarget.IsCFBundleOnApple())
+ else if (target->Target->IsCFBundleOnApple())
return "wrapper.plug-in";
else
return ((this->XcodeVersion >= 22)?
"compiled.mach-o.executable" : "compiled.mach-o.dylib");
case cmState::SHARED_LIBRARY:
- return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
+ return (target->GetPropertyAsBool("FRAMEWORK")?
"wrapper.framework" : "compiled.mach-o.dylib");
case cmState::EXECUTABLE:
return "compiled.mach-o.executable";
@@ -2665,28 +2666,29 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
}
//----------------------------------------------------------------------------
-const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
+const char* cmGlobalXCodeGenerator::GetTargetProductType(
+ cmGeneratorTarget* target)
{
- switch(cmtarget.GetType())
+ switch(target->GetType())
{
case cmState::OBJECT_LIBRARY:
case cmState::STATIC_LIBRARY:
return "com.apple.product-type.library.static";
case cmState::MODULE_LIBRARY:
- if (cmtarget.IsXCTestOnApple())
+ if (target->Target->IsXCTestOnApple())
return "com.apple.product-type.bundle.unit-test";
- else if (cmtarget.IsCFBundleOnApple())
+ else if (target->Target->IsCFBundleOnApple())
return "com.apple.product-type.bundle";
else
return ((this->XcodeVersion >= 22)?
"com.apple.product-type.tool" :
"com.apple.product-type.library.dynamic");
case cmState::SHARED_LIBRARY:
- return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
+ return (target->GetPropertyAsBool("FRAMEWORK")?
"com.apple.product-type.framework" :
"com.apple.product-type.library.dynamic");
case cmState::EXECUTABLE:
- return (cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")?
+ return (target->GetPropertyAsBool("MACOSX_BUNDLE")?
"com.apple.product-type.application" :
"com.apple.product-type.tool");
default: break;
@@ -2727,9 +2729,11 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
target->AddAttribute("name", this->CreateString(cmtarget.GetName()));
target->AddAttribute("productName",this->CreateString(cmtarget.GetName()));
+ cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
+
cmXCodeObject* fileRef =
this->CreateObject(cmXCodeObject::PBXFileReference);
- if(const char* fileType = this->GetTargetFileType(cmtarget))
+ if(const char* fileType = this->GetTargetFileType(gtgt))
{
fileRef->AddAttribute("explicitFileType", this->CreateString(fileType));
}
@@ -2742,7 +2746,6 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
}
else
{
- cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
fullName = gtgt->GetFullName(defConfig.c_str());
}
fileRef->AddAttribute("path", this->CreateString(fullName.c_str()));
@@ -2752,7 +2755,7 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget,
fileRef->SetComment(cmtarget.GetName().c_str());
target->AddAttribute("productReference",
this->CreateObjectReference(fileRef));
- if(const char* productType = this->GetTargetProductType(cmtarget))
+ if(const char* productType = this->GetTargetProductType(gtgt))
{
target->AddAttribute("productType", this->CreateString(productType));
}
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 9daf0ab..feb5009 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -137,8 +137,8 @@ private:
void ForceLinkerLanguages();
void ForceLinkerLanguage(cmTarget& cmtarget);
const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
- const char* GetTargetFileType(cmTarget& cmtarget);
- const char* GetTargetProductType(cmTarget& cmtarget);
+ const char* GetTargetFileType(cmGeneratorTarget* target);
+ const char* GetTargetProductType(cmGeneratorTarget* target);
std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget);
void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
const char* value);