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/cmMakefileTargetGenerator.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/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 9dcd8f1..69320da 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -310,8 +310,12 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() this->LocalGenerator->AddSharedFlags(flags, lang, shared); // Add include directory flags. + this->AddIncludeFlags(flags, lang); + + // Append old-style preprocessor definition flags. this->LocalGenerator-> - AppendFlags(flags, this->LocalGenerator->GetIncludeFlags(lang)); + AppendFlags(flags, this->Makefile->GetDefineFlags()); + // Add include directory flags. this->LocalGenerator-> AppendFlags(flags,this->GetFrameworkFlags().c_str()); @@ -482,6 +486,8 @@ cmMakefileTargetGenerator { this->LocalGenerator->AppendRuleDepend(depends, this->FlagFileNameFull.c_str()); + this->LocalGenerator->AppendRuleDepends(depends, + this->FlagFileDepends[lang]); // generate the depend scanning rule this->WriteObjectDependRules(source, depends); @@ -1720,6 +1726,38 @@ cmMakefileTargetGenerator } //---------------------------------------------------------------------------- +void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags, + const char* lang) +{ + std::string responseVar = "CMAKE_"; + responseVar += lang; + responseVar += "_USE_RESPONSE_FILE_FOR_INCLUDES"; + bool useResponseFile = this->Makefile->IsOn(responseVar.c_str()); + + std::string includeFlags = + this->LocalGenerator->GetIncludeFlags(lang, useResponseFile); + if(includeFlags.empty()) + { + return; + } + + if(useResponseFile) + { + std::string name = "includes_"; + name += lang; + name += ".rsp"; + std::string arg = "@" + + this->CreateResponseFile(name.c_str(), includeFlags, + this->FlagFileDepends[lang]); + this->LocalGenerator->AppendFlags(flags, arg.c_str()); + } + else + { + this->LocalGenerator->AppendFlags(flags, includeFlags.c_str()); + } +} + +//---------------------------------------------------------------------------- const char* cmMakefileTargetGenerator::GetFortranModuleDirectory() { // Compute the module directory. |