Merge topic 'xcode-framework-paths'
f0d9385 Makefile: Use modern link information for framework search paths 2bc22bd Xcode: Add frameworks search paths from link dependeny closure (#13397)
This commit is contained in:
commit
bc9dcadf19
@ -1997,15 +1997,20 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||||||
dirs.Add(incpath.c_str());
|
dirs.Add(incpath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::vector<std::string>& frameworks = target.GetFrameworks();
|
if(target.GetType() != cmTarget::OBJECT_LIBRARY &&
|
||||||
if(frameworks.size())
|
target.GetType() != cmTarget::STATIC_LIBRARY)
|
||||||
{
|
{
|
||||||
for(std::vector<std::string>::iterator fmIt = frameworks.begin();
|
// Add framework search paths needed for linking.
|
||||||
fmIt != frameworks.end(); ++fmIt)
|
if(cmComputeLinkInformation* cli = target.GetLinkInformation(configName))
|
||||||
{
|
{
|
||||||
if(emitted.insert(*fmIt).second)
|
std::vector<std::string> const& fwDirs = cli->GetFrameworkPaths();
|
||||||
|
for(std::vector<std::string>::const_iterator fdi = fwDirs.begin();
|
||||||
|
fdi != fwDirs.end(); ++fdi)
|
||||||
{
|
{
|
||||||
fdirs.Add(this->XCodeEscapePath(fmIt->c_str()).c_str());
|
if(emitted.insert(*fdi).second)
|
||||||
|
{
|
||||||
|
fdirs.Add(this->XCodeEscapePath(fdi->c_str()).c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2691,25 +2696,6 @@ void cmGlobalXCodeGenerator
|
|||||||
linkDirs.c_str(), configName);
|
linkDirs.c_str(), configName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the framework search paths
|
|
||||||
{
|
|
||||||
const char* sep = "";
|
|
||||||
std::string fdirs;
|
|
||||||
std::vector<std::string> const& fwDirs = cli.GetFrameworkPaths();
|
|
||||||
for(std::vector<std::string>::const_iterator fdi = fwDirs.begin();
|
|
||||||
fdi != fwDirs.end(); ++fdi)
|
|
||||||
{
|
|
||||||
fdirs += sep;
|
|
||||||
sep = " ";
|
|
||||||
fdirs += this->XCodeEscapePath(fdi->c_str());
|
|
||||||
}
|
|
||||||
if(!fdirs.empty())
|
|
||||||
{
|
|
||||||
this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
|
|
||||||
fdirs.c_str(), configName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// now add the link libraries
|
// now add the link libraries
|
||||||
{
|
{
|
||||||
std::string linkLibs;
|
std::string linkLibs;
|
||||||
|
@ -1550,10 +1550,10 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
|
|||||||
this->LocalGenerator->GetIncludeDirectories(includes,
|
this->LocalGenerator->GetIncludeDirectories(includes,
|
||||||
this->GeneratorTarget,
|
this->GeneratorTarget,
|
||||||
"C", config);
|
"C", config);
|
||||||
std::vector<std::string>::iterator i;
|
|
||||||
// check all include directories for frameworks as this
|
// check all include directories for frameworks as this
|
||||||
// will already have added a -F for the framework
|
// will already have added a -F for the framework
|
||||||
for(i = includes.begin(); i != includes.end(); ++i)
|
for(std::vector<std::string>::iterator i = includes.begin();
|
||||||
|
i != includes.end(); ++i)
|
||||||
{
|
{
|
||||||
if(this->Target->NameResolvesToFramework(i->c_str()))
|
if(this->Target->NameResolvesToFramework(i->c_str()))
|
||||||
{
|
{
|
||||||
@ -1565,8 +1565,11 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string flags;
|
std::string flags;
|
||||||
std::vector<std::string>& frameworks = this->Target->GetFrameworks();
|
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
|
||||||
for(i = frameworks.begin();
|
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
|
||||||
|
{
|
||||||
|
std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
|
||||||
|
for(std::vector<std::string>::const_iterator i = frameworks.begin();
|
||||||
i != frameworks.end(); ++i)
|
i != frameworks.end(); ++i)
|
||||||
{
|
{
|
||||||
if(emitted.insert(*i).second)
|
if(emitted.insert(*i).second)
|
||||||
@ -1578,6 +1581,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
|
|||||||
flags += " ";
|
flags += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2092,26 +2092,6 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname)
|
|||||||
NameResolvesToFramework(libname);
|
NameResolvesToFramework(libname);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType)
|
|
||||||
{
|
|
||||||
if(this->NameResolvesToFramework(libname.c_str()))
|
|
||||||
{
|
|
||||||
std::string frameworkDir = libname;
|
|
||||||
frameworkDir += "/../";
|
|
||||||
frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
|
|
||||||
std::vector<std::string>::iterator i =
|
|
||||||
std::find(this->Frameworks.begin(),
|
|
||||||
this->Frameworks.end(), frameworkDir);
|
|
||||||
if(i == this->Frameworks.end())
|
|
||||||
{
|
|
||||||
this->Frameworks.push_back(frameworkDir);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
||||||
const char *target, const char* lib,
|
const char *target, const char* lib,
|
||||||
@ -2122,7 +2102,6 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->AddFramework(lib, llt);
|
|
||||||
cmTarget::LibraryID tmp;
|
cmTarget::LibraryID tmp;
|
||||||
tmp.first = lib;
|
tmp.first = lib;
|
||||||
tmp.second = llt;
|
tmp.second = llt;
|
||||||
|
@ -109,9 +109,6 @@ public:
|
|||||||
std::vector<cmCustomCommand> &GetPostBuildCommands()
|
std::vector<cmCustomCommand> &GetPostBuildCommands()
|
||||||
{return this->PostBuildCommands;}
|
{return this->PostBuildCommands;}
|
||||||
|
|
||||||
///! Return the list of frameworks being linked to this target
|
|
||||||
std::vector<std::string> &GetFrameworks() {return this->Frameworks;}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of the source files used by this target
|
* Get the list of the source files used by this target
|
||||||
*/
|
*/
|
||||||
@ -179,7 +176,6 @@ public:
|
|||||||
|
|
||||||
// Check to see if a library is a framework and treat it different on Mac
|
// Check to see if a library is a framework and treat it different on Mac
|
||||||
bool NameResolvesToFramework(const std::string& libname);
|
bool NameResolvesToFramework(const std::string& libname);
|
||||||
bool AddFramework(const std::string& lib, LinkLibraryType llt);
|
|
||||||
void AddLinkLibrary(cmMakefile& mf,
|
void AddLinkLibrary(cmMakefile& mf,
|
||||||
const char *target, const char* lib,
|
const char *target, const char* lib,
|
||||||
LinkLibraryType llt);
|
LinkLibraryType llt);
|
||||||
@ -569,7 +565,6 @@ private:
|
|||||||
LinkLibraryVectorType LinkLibraries;
|
LinkLibraryVectorType LinkLibraries;
|
||||||
LinkLibraryVectorType PrevLinkedLibraries;
|
LinkLibraryVectorType PrevLinkedLibraries;
|
||||||
bool LinkLibrariesAnalyzed;
|
bool LinkLibrariesAnalyzed;
|
||||||
std::vector<std::string> Frameworks;
|
|
||||||
std::vector<std::string> LinkDirectories;
|
std::vector<std::string> LinkDirectories;
|
||||||
std::set<cmStdString> LinkDirectoriesEmmitted;
|
std::set<cmStdString> LinkDirectoriesEmmitted;
|
||||||
bool HaveInstallRule;
|
bool HaveInstallRule;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user