diff options
author | Brad King <brad.king@kitware.com> | 2011-03-22 18:45:44 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-03-22 18:45:44 (GMT) |
commit | 1c3233a850843bf8cf4863f1f0df9378708edffc (patch) | |
tree | e598918be33a3b76ce1ccf5caf9508712c376cad /Source/cmLocalGenerator.cxx | |
parent | 685d8935006ef8ea29f5ae6636dbb29b216fa9ef (diff) | |
parent | 86cb17b18de78e178b76e9be471789084994a162 (diff) | |
download | CMake-1c3233a850843bf8cf4863f1f0df9378708edffc.zip CMake-1c3233a850843bf8cf4863f1f0df9378708edffc.tar.gz CMake-1c3233a850843bf8cf4863f1f0df9378708edffc.tar.bz2 |
Merge topic 'include-flags-response-file'
86cb17b Pass include directories with response files to GNU on Windows
9a0b9bc Optionally pass include directories with response files
6e8a67f Generate target-wide flags before individual build rules
d099546 Factor old-style -D flags out from -I flag generation
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cd265c1..7b3fc86 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -575,6 +575,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, flags += this->Makefile->GetSafeDefinition(varString.c_str()); flags += " "; flags += this->GetIncludeFlags(lang); + flags += this->Makefile->GetDefineFlags(); // Construct the command lines. cmCustomCommandLines commandLines; @@ -1184,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; @@ -1250,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; @@ -1273,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 << "\""; @@ -1291,13 +1304,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) { flags[flags.size()-1] = ' '; } - std::string defineFlags = this->Makefile->GetDefineFlags(); - flags += defineFlags; - 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; } |