diff options
author | Brad King <brad.king@kitware.com> | 2020-03-02 15:47:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-02 15:48:05 (GMT) |
commit | 178a166ae154effcd0f578bdca45744de956d4f9 (patch) | |
tree | 237f11f5685d61f5f77128c8d14a2d04545c55c5 /Source | |
parent | 813b505c67a0ab49d3b87ddc0577c6fc38190b50 (diff) | |
parent | 92785ed74645e2331fca15ca1f657377c936a795 (diff) | |
download | CMake-178a166ae154effcd0f578bdca45744de956d4f9.zip CMake-178a166ae154effcd0f578bdca45744de956d4f9.tar.gz CMake-178a166ae154effcd0f578bdca45744de956d4f9.tar.bz2 |
Merge topic 'xl-fortran-module-dir-use'
92785ed746 Tests: Enable Fortran submodule tests on XL compilers
210b0b99a9 XL: Fix using Fortran modules from their output directory
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4405
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalCommonGenerator.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 025ef7e..278ec8b 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -50,6 +50,15 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags( this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG"), mod_dir); this->AppendFlags(flags, modflag); + // Some compilers do not search their own module output directory + // for using other modules. Add an include directory explicitly + // for consistency with compilers that do search it. + std::string incflag = + this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_INCLUDE_FLAG"); + if (!incflag.empty()) { + incflag = cmStrCat(incflag, mod_dir); + this->AppendFlags(flags, incflag); + } } // If there is a separate module path flag then duplicate the |