summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-12-07 18:27:52 (GMT)
committerBrad King <brad.king@kitware.com>2012-12-07 20:29:21 (GMT)
commitf0d938549eead63fb86bec28c299a1bceacbdd6b (patch)
treee73fec148a778613f42953c3ed0c90b4d6351d6b /Source
parent2bc22bdaacfc0f0f91c229685dc5dbadd0267601 (diff)
downloadCMake-f0d938549eead63fb86bec28c299a1bceacbdd6b.zip
CMake-f0d938549eead63fb86bec28c299a1bceacbdd6b.tar.gz
CMake-f0d938549eead63fb86bec28c299a1bceacbdd6b.tar.bz2
Makefile: Use modern link information for framework search paths
Use cmComputeLinkInformation::GetFrameworkPaths to get the list of framework paths needed by the linker. Drop the now unused framework information from the old-style cmTarget link dependency analysis.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx26
-rw-r--r--Source/cmTarget.cxx21
-rw-r--r--Source/cmTarget.h5
3 files changed, 15 insertions, 37 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2b89c79..9bf6b7d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1550,10 +1550,10 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget,
"C", config);
- std::vector<std::string>::iterator i;
// check all include directories for frameworks as this
// 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()))
{
@@ -1565,17 +1565,21 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
}
std::string flags;
- std::vector<std::string>& frameworks = this->Target->GetFrameworks();
- for(i = frameworks.begin();
- i != frameworks.end(); ++i)
+ const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
+ if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
- if(emitted.insert(*i).second)
+ std::vector<std::string> const& frameworks = cli->GetFrameworkPaths();
+ for(std::vector<std::string>::const_iterator i = frameworks.begin();
+ i != frameworks.end(); ++i)
{
- flags += "-F";
- flags += this->Convert(i->c_str(),
- cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::SHELL, true);
- flags += " ";
+ if(emitted.insert(*i).second)
+ {
+ flags += "-F";
+ flags += this->Convert(i->c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL, true);
+ flags += " ";
+ }
}
}
return flags;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index be20464..de3b23c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2093,26 +2093,6 @@ bool cmTarget::NameResolvesToFramework(const std::string& 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,
const char *target, const char* lib,
LinkLibraryType llt)
@@ -2122,7 +2102,6 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
{
return;
}
- this->AddFramework(lib, llt);
cmTarget::LibraryID tmp;
tmp.first = lib;
tmp.second = llt;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 9efd638..0dfbc68 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -109,9 +109,6 @@ public:
std::vector<cmCustomCommand> &GetPostBuildCommands()
{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
*/
@@ -179,7 +176,6 @@ public:
// Check to see if a library is a framework and treat it different on Mac
bool NameResolvesToFramework(const std::string& libname);
- bool AddFramework(const std::string& lib, LinkLibraryType llt);
void AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib,
LinkLibraryType llt);
@@ -569,7 +565,6 @@ private:
LinkLibraryVectorType LinkLibraries;
LinkLibraryVectorType PrevLinkedLibraries;
bool LinkLibrariesAnalyzed;
- std::vector<std::string> Frameworks;
std::vector<std::string> LinkDirectories;
std::set<cmStdString> LinkDirectoriesEmmitted;
bool HaveInstallRule;