BUG: Do not filter system directories for include file dependencies.

This commit is contained in:
Brad King 2006-09-28 09:49:40 -04:00
parent c717db3b88
commit 0b135767d6
3 changed files with 18 additions and 13 deletions

View File

@ -1096,7 +1096,8 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs) void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
bool filter_system_dirs)
{ {
// Need to decide whether to automatically include the source and // Need to decide whether to automatically include the source and
// binary directories at the beginning of the include path. // binary directories at the beginning of the include path.
@ -1170,6 +1171,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs)
} }
} }
if(filter_system_dirs)
{
// Do not explicitly add the standard include path "/usr/include". // Do not explicitly add the standard include path "/usr/include".
// This can cause problems with certain standard library // This can cause problems with certain standard library
// implementations because the wrong headers may be found first. // implementations because the wrong headers may be found first.
@ -1184,6 +1187,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs)
emitted.insert(implicitIncludeVec[k]); emitted.insert(implicitIncludeVec[k]);
} }
} }
}
// Get the project-specified include directories. // Get the project-specified include directories.
std::vector<std::string>& includes = std::vector<std::string>& includes =

View File

@ -170,7 +170,8 @@ public:
std::vector<cmStdString>* fullPathLibs=0); std::vector<cmStdString>* fullPathLibs=0);
/** Get the include flags for the current makefile and language. */ /** Get the include flags for the current makefile and language. */
void GetIncludeDirectories(std::vector<std::string>& dirs); void GetIncludeDirectories(std::vector<std::string>& dirs,
bool filter_system_dirs = true);
/** Compute the language used to compile the given source file. */ /** Compute the language used to compile the given source file. */
const char* GetSourceFileLanguage(const cmSourceFile& source); const char* GetSourceFileLanguage(const cmSourceFile& source);

View File

@ -467,7 +467,7 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
infoFileStream infoFileStream
<< "SET(CMAKE_C_INCLUDE_PATH\n"; << "SET(CMAKE_C_INCLUDE_PATH\n";
std::vector<std::string> includeDirs; std::vector<std::string> includeDirs;
this->GetIncludeDirectories(includeDirs); this->GetIncludeDirectories(includeDirs, false);
for(std::vector<std::string>::iterator i = includeDirs.begin(); for(std::vector<std::string>::iterator i = includeDirs.begin();
i != includeDirs.end(); ++i) i != includeDirs.end(); ++i)
{ {