From 8c3290b4a3d16808bc49a1365c7ea792e64996ee Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 26 Feb 2009 09:16:16 -0500 Subject: [PATCH] BUG: Use new include dir suppresson for all gens This fixes CMAKE__IMPLICIT_INCLUDE_DIRECTORIES to be used for all generators instead of just those that construct their own compiler command lines directly. See issue #8598. --- Source/cmLocalGenerator.cxx | 41 ++++++++++++++++--------------------- Source/cmLocalGenerator.h | 3 ++- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a6bc6ad5e..246731fef 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1187,25 +1187,9 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) return this->LanguageToIncludeFlags[lang].c_str(); } - // Load implicit include directories for this language. - std::set impDirs; - std::string impDirVar = "CMAKE_"; - impDirVar += lang; - impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES"; - if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str())) - { - std::vector impDirVec; - cmSystemTools::ExpandListArgument(value, impDirVec); - for(std::vector::const_iterator i = impDirVec.begin(); - i != impDirVec.end(); ++i) - { - impDirs.insert(*i); - } - } - cmOStringStream includeFlags; std::vector includes; - this->GetIncludeDirectories(includes); + this->GetIncludeDirectories(includes, lang); std::vector::iterator i; std::string flagVar = "CMAKE_INCLUDE_FLAG_"; @@ -1250,11 +1234,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) #endif for(i = includes.begin(); i != includes.end(); ++i) { - // Skip implicit include directories. - if(impDirs.find(*i) != impDirs.end()) - { - continue; - } #ifdef __APPLE__ if(cmSystemTools::IsPathToFramework(i->c_str())) { @@ -1315,7 +1294,8 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) } //---------------------------------------------------------------------------- -void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs) +void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, + const char* lang) { // Need to decide whether to automatically include the source and // binary directories at the beginning of the include path. @@ -1381,6 +1361,21 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs) } } + // Load implicit include directories for this language. + std::string impDirVar = "CMAKE_"; + impDirVar += lang; + impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES"; + if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str())) + { + std::vector impDirVec; + cmSystemTools::ExpandListArgument(value, impDirVec); + for(std::vector::const_iterator i = impDirVec.begin(); + i != impDirVec.end(); ++i) + { + emitted.insert(*i); + } + } + // Get the project-specified include directories. std::vector& includes = this->Makefile->GetIncludeDirectories(); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 75da316b1..e75ddae83 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -189,7 +189,8 @@ public: { return true; } /** Get the include flags for the current makefile and language. */ - void GetIncludeDirectories(std::vector& dirs); + void GetIncludeDirectories(std::vector& dirs, + const char* lang = "C"); /** Compute the language used to compile the given source file. */ const char* GetSourceFileLanguage(const cmSourceFile& source);