From d099546450a9c9ce12763cab1af182b2d98ebba6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 15 Mar 2011 13:09:06 -0400 Subject: [PATCH] Factor old-style -D flags out from -I flag generation Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to all call sites so that the method exclusively constructs a string of include search path flags. --- Source/cmLocalGenerator.cxx | 3 +-- Source/cmMakefileTargetGenerator.cxx | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d3cbc1ff7..29853e55c 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; @@ -1291,8 +1292,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) { flags[flags.size()-1] = ' '; } - std::string defineFlags = this->Makefile->GetDefineFlags(); - flags += defineFlags; this->LanguageToIncludeFlags[lang] = flags; // Use this temorary variable for the return value to work-around a diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 9dcd8f18e..a6f777707 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -312,6 +312,11 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() // Add include directory flags. this->LocalGenerator-> AppendFlags(flags, this->LocalGenerator->GetIncludeFlags(lang)); + + // Append old-style preprocessor definition flags. + this->LocalGenerator-> + AppendFlags(flags, this->Makefile->GetDefineFlags()); + // Add include directory flags. this->LocalGenerator-> AppendFlags(flags,this->GetFrameworkFlags().c_str());