diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index d09b4423a..a16f2b554 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -181,12 +181,13 @@ class FortranCompiler(Compiler): def module_name_to_filename(self, module_name: str) -> str: if '_' in module_name: # submodule + s = module_name.lower() if self.id in ('gcc', 'intel'): - filename = module_name.lower() + '.smod' + filename = s.replace('_', '@') + '.smod' elif self.id in ('pgi', 'flang'): - filename = module_name.lower() + '.mod' + filename = s.replace('_', '-') + '.mod' else: - filename = module_name.lower() + '.mod' + filename = s + '.mod' else: # module filename = module_name.lower() + '.mod'