diff options
author | Brad King <brad.king@kitware.com> | 2009-02-26 09:16:16 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-02-26 09:16:16 -0500 |
commit | 8c3290b4a3d16808bc49a1365c7ea792e64996ee (patch) | |
tree | 857b89ad9e8de9f0bfc61ae87970c2a0d6894747 /Source/cmLocalGenerator.cxx | |
parent | 3498a8c66864dd5caddf770b8fe6ff24b2b61415 (diff) | |
download | cmake-8c3290b4a3d16808bc49a1365c7ea792e64996ee.tar.gz |
BUG: Use new include dir suppresson for all gens
This fixes CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to be used for all
generators instead of just those that construct their own compiler
command lines directly. See issue #8598.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a6bc6ad5ed..246731fef4 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<cmStdString> impDirs; - std::string impDirVar = "CMAKE_"; - impDirVar += lang; - impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES"; - if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str())) - { - std::vector<std::string> impDirVec; - cmSystemTools::ExpandListArgument(value, impDirVec); - for(std::vector<std::string>::const_iterator i = impDirVec.begin(); - i != impDirVec.end(); ++i) - { - impDirs.insert(*i); - } - } - cmOStringStream includeFlags; std::vector<std::string> includes; - this->GetIncludeDirectories(includes); + this->GetIncludeDirectories(includes, lang); std::vector<std::string>::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<std::string>& dirs) +void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& 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<std::string>& 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<std::string> impDirVec; + cmSystemTools::ExpandListArgument(value, impDirVec); + for(std::vector<std::string>::const_iterator i = impDirVec.begin(); + i != impDirVec.end(); ++i) + { + emitted.insert(*i); + } + } + // Get the project-specified include directories. std::vector<std::string>& includes = this->Makefile->GetIncludeDirectories(); |