diff options
author | Brad King <brad.king@kitware.com> | 2019-02-25 12:48:27 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-25 12:48:35 (GMT) |
commit | 283b8c2ae6234d7f71bfe372c71a80deadf9b39d (patch) | |
tree | 84d499691f36efefdbf935e2595a6daaaaeceef4 /Source/cmLocalGenerator.cxx | |
parent | 3fff09096ab87914a08499958d956c2be1fdd085 (diff) | |
parent | 3dc81a48ffbf22e044678736996272ef1b8395ff (diff) | |
download | CMake-283b8c2ae6234d7f71bfe372c71a80deadf9b39d.zip CMake-283b8c2ae6234d7f71bfe372c71a80deadf9b39d.tar.gz CMake-283b8c2ae6234d7f71bfe372c71a80deadf9b39d.tar.bz2 |
Merge topic 'fix-implicit-includes-fortran'
3dc81a48ff Fortran: Do not suppress explicit use of implicit include directories
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.co>
Merge-request: !2994
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-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 8393165..7241dde 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -944,15 +944,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]); + } } } |