summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx40
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.