BUG: We don't want to output -I/usr/include in the INCLUDE_FLAGS variable. This causes problems with finding system headers in the wrong places for certain standard library implementations.

This commit is contained in:
Brad King 2001-08-02 09:07:21 -04:00
parent 8a03ccda07
commit 9e5c769c29
1 changed files with 7 additions and 1 deletions

View File

@ -659,7 +659,13 @@ void cmUnixMakefileGenerator::OutputMakeFlags(std::ostream& fout)
for(i = includes.begin(); i != includes.end(); ++i)
{
std::string include = *i;
fout << "-I" << cmSystemTools::EscapeSpaces(i->c_str()).c_str() << " ";
// Don't output a -I for the standard include path "/usr/include".
// This can cause problems with certain standard library
// implementations because the wrong headers may be found first.
if(include != "/usr/include")
{
fout << "-I" << cmSystemTools::EscapeSpaces(i->c_str()).c_str() << " ";
}
}
fout << m_Makefile->GetDefineFlags();
fout << "\n\n";