summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-15 18:07:36 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-17 21:56:13 (GMT)
commit9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a (patch)
tree5afc4348887308de45cfc01ad573ac9f3b221805 /Source/cmLocalGenerator.cxx
parent6e8a67f99a34f2166ee838eb68968ae200830cac (diff)
downloadCMake-9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a.zip
CMake-9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a.tar.gz
CMake-9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a.tar.bz2
Optionally pass include directories with response files
Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to enable use of response files for passing the list of include directories to compiler command lines.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx28
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 29853e5..7da35eb 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1185,15 +1185,18 @@ cmLocalGenerator::ConvertToOutputForExisting(RelativeRoot remote,
}
//----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
+const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
+ bool forResponseFile)
{
if(!lang)
{
return "";
}
- if(this->LanguageToIncludeFlags.count(lang))
+ std::string key = lang;
+ key += forResponseFile? "@" : "";
+ if(this->LanguageToIncludeFlags.count(key))
{
- return this->LanguageToIncludeFlags[lang].c_str();
+ return this->LanguageToIncludeFlags[key].c_str();
}
cmOStringStream includeFlags;
@@ -1251,10 +1254,10 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
if(emitted.insert(frameworkDir).second)
{
+ OutputFormat format = forResponseFile? RESPONSE : SHELL;
includeFlags
<< "-F" << this->Convert(frameworkDir.c_str(),
- cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::SHELL, true)
+ START_OUTPUT, format, true)
<< " ";
}
continue;
@@ -1274,7 +1277,16 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
}
flagUsed = true;
}
- std::string includePath = this->ConvertToOutputForExisting(i->c_str());
+ std::string includePath;
+ if(forResponseFile)
+ {
+ includePath = this->Convert(i->c_str(), START_OUTPUT,
+ RESPONSE, true);
+ }
+ else
+ {
+ includePath = this->ConvertToOutputForExisting(i->c_str());
+ }
if(quotePaths && includePath.size() && includePath[0] != '\"')
{
includeFlags << "\"";
@@ -1292,11 +1304,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
{
flags[flags.size()-1] = ' ';
}
- this->LanguageToIncludeFlags[lang] = flags;
+ this->LanguageToIncludeFlags[key] = flags;
// Use this temorary variable for the return value to work-around a
// bogus GCC 2.95 warning.
- const char* ret = this->LanguageToIncludeFlags[lang].c_str();
+ const char* ret = this->LanguageToIncludeFlags[key].c_str();
return ret;
}