diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-06-08 09:29:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-09 14:41:42 (GMT) |
commit | d9613b962e2ed5c908850c8a083630f753dac113 (patch) | |
tree | 1ca35a6c61495a0f2270b1e711f1e37b95ce5fd6 /Source/cmLocalGenerator.cxx | |
parent | 70d3bf85808d17dba8ec90e2975f2741383ef260 (diff) | |
download | CMake-d9613b962e2ed5c908850c8a083630f753dac113.zip CMake-d9613b962e2ed5c908850c8a083630f753dac113.tar.gz CMake-d9613b962e2ed5c908850c8a083630f753dac113.tar.bz2 |
cmLocalGenerator: Move GetFrameworkFlags implementation to private helper
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9c503c2..f543ec4 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1271,16 +1271,19 @@ void cmLocalGenerator::GetTargetFlags( } } -std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l, - std::string const& config, - cmGeneratorTarget* target) +static std::string GetFrameworkFlags(const std::string& lang, + const std::string& config, + cmGeneratorTarget* target) { - if (!this->Makefile->IsOn("APPLE")) { + cmLocalGenerator* lg = target->GetLocalGenerator(); + cmMakefile* mf = lg->GetMakefile(); + + if (!mf->IsOn("APPLE")) { return std::string(); } - std::string fwSearchFlagVar = "CMAKE_" + l + "_FRAMEWORK_SEARCH_FLAG"; - const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar); + std::string fwSearchFlagVar = "CMAKE_" + lang + "_FRAMEWORK_SEARCH_FLAG"; + const char* fwSearchFlag = mf->GetDefinition(fwSearchFlagVar); if (!(fwSearchFlag && *fwSearchFlag)) { return std::string(); } @@ -1291,12 +1294,12 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l, #endif std::vector<std::string> includes; - this->GetIncludeDirectories(includes, target, "C", config); + lg->GetIncludeDirectories(includes, target, "C", config); // check all include directories for frameworks as this // will already have added a -F for the framework for (std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { - if (this->GlobalGenerator->NameResolvesToFramework(*i)) { + if (lg->GetGlobalGenerator()->NameResolvesToFramework(*i)) { std::string frameworkDir = *i; frameworkDir += "/../"; frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir); @@ -1311,7 +1314,7 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l, i != frameworks.end(); ++i) { if (emitted.insert(*i).second) { flags += fwSearchFlag; - flags += this->ConvertToOutputFormat(*i, cmOutputConverter::SHELL); + flags += lg->ConvertToOutputFormat(*i, cmOutputConverter::SHELL); flags += " "; } } @@ -1319,6 +1322,13 @@ std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l, return flags; } +std::string cmLocalGenerator::GetFrameworkFlags(std::string const& l, + std::string const& config, + cmGeneratorTarget* target) +{ + return ::GetFrameworkFlags(l, config, target); +} + std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib, OutputFormat format) { |