mirror of
https://github.com/reactos/CMake.git
synced 2025-01-24 12:45:01 +00:00
Xcode: Port internal API to cmGeneratorTarget.
This commit is contained in:
parent
eb3be7d688
commit
a527abf099
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user