diff options
author | Brad King <brad.king@kitware.com> | 2019-02-20 13:57:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-20 13:57:20 (GMT) |
commit | c36bf6b13c6798d6388a2b4ca0c802a47f1b1ed4 (patch) | |
tree | 9c5258a3a7ea77afb0204e8f449d9dd103794325 /Source | |
parent | 0794dd3018191ba919d9e8ada3ed18ad2b37eccd (diff) | |
parent | 3dc81a48ffbf22e044678736996272ef1b8395ff (diff) | |
download | CMake-c36bf6b13c6798d6388a2b4ca0c802a47f1b1ed4.zip CMake-c36bf6b13c6798d6388a2b4ca0c802a47f1b1ed4.tar.gz CMake-c36bf6b13c6798d6388a2b4ca0c802a47f1b1ed4.tar.bz2 |
Merge branch 'fix-implicit-includes-fortran' into release-3.14
Merge-request: !2994
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 8b01af1..7e56818 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -947,15 +947,21 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( std::vector<std::string> impDirVec = userStandardDirs; // Load implicit include directories for this language. - std::string key = "CMAKE_"; - key += lang; - key += "_IMPLICIT_INCLUDE_DIRECTORIES"; - if (const char* value = this->Makefile->GetDefinition(key)) { - size_t const impDirVecOldSize = impDirVec.size(); - cmSystemTools::ExpandListArgument(value, impDirVec); - // FIXME: Use cmRange with 'advance()' when it supports non-const. - for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) { - cmSystemTools::ConvertToUnixSlashes(impDirVec[i]); + // We ignore this for Fortran because: + // * There are no standard library headers to avoid overriding. + // * Compilers like gfortran do not search their own implicit include + // directories for modules ('.mod' files). + if (lang != "Fortran") { + std::string key = "CMAKE_"; + key += lang; + key += "_IMPLICIT_INCLUDE_DIRECTORIES"; + if (const char* value = this->Makefile->GetDefinition(key)) { + size_t const impDirVecOldSize = impDirVec.size(); + cmSystemTools::ExpandListArgument(value, impDirVec); + // FIXME: Use cmRange with 'advance()' when it supports non-const. + for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) { + cmSystemTools::ConvertToUnixSlashes(impDirVec[i]); + } } } |