Xcode: Port ForceLinkerLanguage to cmGeneratorTarget.
This commit is contained in:
parent
634155d695
commit
ed4ea59a33
@ -1368,22 +1368,22 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages()
|
|||||||
for(TargetMap::const_iterator
|
for(TargetMap::const_iterator
|
||||||
ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
|
ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
|
||||||
{
|
{
|
||||||
this->ForceLinkerLanguage(*ti->second);
|
cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second);
|
||||||
|
this->ForceLinkerLanguage(gt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
|
void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
|
||||||
{
|
{
|
||||||
// This matters only for targets that link.
|
// This matters only for targets that link.
|
||||||
if(cmtarget.GetType() != cmState::EXECUTABLE &&
|
if(gtgt->GetType() != cmState::EXECUTABLE &&
|
||||||
cmtarget.GetType() != cmState::SHARED_LIBRARY &&
|
gtgt->GetType() != cmState::SHARED_LIBRARY &&
|
||||||
cmtarget.GetType() != cmState::MODULE_LIBRARY)
|
gtgt->GetType() != cmState::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&cmtarget);
|
|
||||||
std::string llang = gtgt->GetLinkerLanguage("NOCONFIG");
|
std::string llang = gtgt->GetLinkerLanguage("NOCONFIG");
|
||||||
if(llang.empty()) { return; }
|
if(llang.empty()) { return; }
|
||||||
|
|
||||||
@ -1399,11 +1399,11 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
|
|||||||
// Add an empty source file to the target that compiles with the
|
// Add an empty source file to the target that compiles with the
|
||||||
// linker language. This should convince Xcode to choose the proper
|
// linker language. This should convince Xcode to choose the proper
|
||||||
// language.
|
// language.
|
||||||
cmMakefile* mf = cmtarget.GetMakefile();
|
cmMakefile* mf = gtgt->Target->GetMakefile();
|
||||||
std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
|
std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
|
||||||
fname += cmake::GetCMakeFilesDirectory();
|
fname += cmake::GetCMakeFilesDirectory();
|
||||||
fname += "/";
|
fname += "/";
|
||||||
fname += cmtarget.GetName();
|
fname += gtgt->GetName();
|
||||||
fname += "-CMakeForceLinker";
|
fname += "-CMakeForceLinker";
|
||||||
fname += ".";
|
fname += ".";
|
||||||
fname += cmSystemTools::LowerCase(llang);
|
fname += cmSystemTools::LowerCase(llang);
|
||||||
|
@ -135,7 +135,7 @@ private:
|
|||||||
cmXCodeObject* CreateXCodeTarget(cmTarget& target,
|
cmXCodeObject* CreateXCodeTarget(cmTarget& target,
|
||||||
cmXCodeObject* buildPhases);
|
cmXCodeObject* buildPhases);
|
||||||
void ForceLinkerLanguages();
|
void ForceLinkerLanguages();
|
||||||
void ForceLinkerLanguage(cmTarget& cmtarget);
|
void ForceLinkerLanguage(cmGeneratorTarget* gtgt);
|
||||||
const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
|
const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
|
||||||
const char* GetTargetFileType(cmGeneratorTarget* target);
|
const char* GetTargetFileType(cmGeneratorTarget* target);
|
||||||
const char* GetTargetProductType(cmGeneratorTarget* target);
|
const char* GetTargetProductType(cmGeneratorTarget* target);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user