From 39f8b91125ee3cb426968f089049f393dee1f699 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Feb 2009 15:37:09 -0500 Subject: [PATCH] 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. --- Modules/Platform/Darwin-icc.cmake | 1 - Modules/Platform/Darwin.cmake | 1 - Source/cmLocalGenerator.cxx | 21 +-------------------- Source/cmLocalGenerator.h | 3 +-- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 5 files changed, 3 insertions(+), 25 deletions(-) diff --git a/Modules/Platform/Darwin-icc.cmake b/Modules/Platform/Darwin-icc.cmake index cf7680eed..49aa84319 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -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 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. -SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include ) # default to searching for frameworks first diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 81f33e1a2..b0179f432 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -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 SET(CMAKE_FIND_FRAMEWORK FIRST) # set up the default search directories for frameworks diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0f1c4ee4f..b2788ae6d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1293,8 +1293,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang) } //---------------------------------------------------------------------------- -void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, - bool filter_system_dirs) +void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs) { // Need to decide whether to automatically include the source and // binary directories at the beginning of the include path. @@ -1360,24 +1359,6 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector& 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 implicitIncludeVec; - cmSystemTools::ExpandListArgument(implicitIncludes, implicitIncludeVec); - for(unsigned int k = 0; k < implicitIncludeVec.size(); ++k) - { - emitted.insert(implicitIncludeVec[k]); - } - } - } - // Get the project-specified include directories. std::vector& includes = this->Makefile->GetIncludeDirectories(); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 10ec3b8a0..75da316b1 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -189,8 +189,7 @@ public: { return true; } /** Get the include flags for the current makefile and language. */ - void GetIncludeDirectories(std::vector& dirs, - bool filter_system_dirs = true); + void GetIncludeDirectories(std::vector& dirs); /** Compute the language used to compile the given source file. */ const char* GetSourceFileLanguage(const cmSourceFile& source); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index a65d7c682..f92ff868b 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -500,7 +500,7 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile() infoFileStream << "SET(CMAKE_C_INCLUDE_PATH\n"; std::vector includeDirs; - this->GetIncludeDirectories(includeDirs, false); + this->GetIncludeDirectories(includeDirs); for(std::vector::iterator i = includeDirs.begin(); i != includeDirs.end(); ++i) {