Commit 39f8b911 authored by Brad King's avatar Brad King
Browse files

BUG: Remove implicit include dir suppression

We used to suppress generation of -I/usr/include (and on OSX also
-I/usr/local/include).  This behavior seems to cause more trouble than
it's worth, so I'm removing it until someone encounters the original
problem it fixed.  See issue #8598.
parent ff32962a
...@@ -103,7 +103,6 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE ...@@ -103,7 +103,6 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE
# We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC. # We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC.
# We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler. # We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler.
# I have no idea what the best way to do that would be. # I have no idea what the best way to do that would be.
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include )
# default to searching for frameworks first # default to searching for frameworks first
......
...@@ -217,7 +217,6 @@ SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK ...@@ -217,7 +217,6 @@ SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include)
# default to searching for frameworks first # default to searching for frameworks first
SET(CMAKE_FIND_FRAMEWORK FIRST) SET(CMAKE_FIND_FRAMEWORK FIRST)
# set up the default search directories for frameworks # set up the default search directories for frameworks
......
...@@ -1293,8 +1293,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) ...@@ -1293,8 +1293,7 @@ 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.
...@@ -1360,24 +1359,6 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, ...@@ -1360,24 +1359,6 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
} }
} }
if(filter_system_dirs)
{
// Do not explicitly add the standard include path "/usr/include".
// This can cause problems with certain standard library
// implementations because the wrong headers may be found first.
emitted.insert("/usr/include");
if(const char* implicitIncludes = this->Makefile->GetDefinition
("CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))
{
std::vector<std::string> implicitIncludeVec;
cmSystemTools::ExpandListArgument(implicitIncludes, implicitIncludeVec);
for(unsigned int k = 0; k < implicitIncludeVec.size(); ++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 =
this->Makefile->GetIncludeDirectories(); this->Makefile->GetIncludeDirectories();
......
...@@ -189,8 +189,7 @@ public: ...@@ -189,8 +189,7 @@ public:
{ return true; } { return true; }
/** 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);
......
...@@ -500,7 +500,7 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile() ...@@ -500,7 +500,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, false); this->GetIncludeDirectories(includeDirs);
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)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment