summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-10 12:29:04 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-10 12:33:25 (GMT)
commit2e13c362117dbd0df2d5fff1c00ee8af2707185a (patch)
tree25272e06ea8f577f242c2158dd986210bc6c7d66 /Source/cmMakefileTargetGenerator.cxx
parent872db622d62012d6ea0c2142d75f9a0b97949004 (diff)
downloadCMake-2e13c362117dbd0df2d5fff1c00ee8af2707185a.zip
CMake-2e13c362117dbd0df2d5fff1c00ee8af2707185a.tar.gz
CMake-2e13c362117dbd0df2d5fff1c00ee8af2707185a.tar.bz2
OS X: Encode -F framework search flag in per-language platform variable
Compilers for languages other than C and C++ on OS X may not understand the -F framework search flag. Create a new platform information variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it for C and CXX lanugages in the Platform/Darwin module. Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 42091e3..9ca9149 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -291,7 +291,7 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l)
// Add include directory flags.
this->LocalGenerator->
- AppendFlags(flags,this->GetFrameworkFlags().c_str());
+ AppendFlags(flags,this->GetFrameworkFlags(l).c_str());
// Add target-specific flags.
this->LocalGenerator->AddCompileOptions(flags, this->Target,
@@ -1518,13 +1518,21 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
}
//----------------------------------------------------------------------------
-std::string cmMakefileTargetGenerator::GetFrameworkFlags()
+std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
{
if(!this->Makefile->IsOn("APPLE"))
{
return std::string();
}
+ std::string fwSearchFlagVar = "CMAKE_" + l + "_FRAMEWORK_SEARCH_FLAG";
+ const char* fwSearchFlag =
+ this->Makefile->GetDefinition(fwSearchFlagVar.c_str());
+ if(!(fwSearchFlag && *fwSearchFlag))
+ {
+ return std::string();
+ }
+
std::set<cmStdString> emitted;
#ifdef __APPLE__ /* don't insert this when crosscompiling e.g. to iphone */
emitted.insert("/System/Library/Frameworks");
@@ -1559,7 +1567,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
{
if(emitted.insert(*i).second)
{
- flags += "-F";
+ flags += fwSearchFlag;
flags += this->Convert(i->c_str(),
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL, true);