Merge topic 'fortran-submodule-cray'

b0bcd4d7d2 Fortran: Add support for submodules on Cray
33de4d27eb Fortran: Support compilers using no module prefix on submodule files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3504
This commit is contained in:
Brad King
2019-07-08 15:43:31 +00:00
committed by Kitware Robot
2 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,8 @@
include(Compiler/Cray)
__compiler_cray(Fortran)
set(CMAKE_Fortran_SUBMODULE_SEP "")
set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
set(CMAKE_Fortran_MODOUT_FLAG -em)
set(CMAKE_Fortran_MODDIR_FLAG -J)
set(CMAKE_Fortran_MODDIR_DEFAULT .)

View File

@@ -79,7 +79,13 @@ std::string cmFortranParser_s::ModName(std::string const& mod_name) const
std::string cmFortranParser_s::SModName(std::string const& mod_name,
std::string const& sub_name) const
{
return mod_name + this->Compiler.SModSep + sub_name + this->Compiler.SModExt;
std::string const& SModExt =
this->Compiler.SModExt.empty() ? ".mod" : this->Compiler.SModExt;
// An empty separator means that the compiler does not use a prefix.
if (this->Compiler.SModSep.empty()) {
return sub_name + SModExt;
}
return mod_name + this->Compiler.SModSep + sub_name + SModExt;
}
bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)