diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-26 20:18:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 20:18:34 +0200 |
commit | 6253bbc6cc18f2850d924eac690338dcdf45a23b (patch) | |
tree | 85fdcc0edf74a374f36c9db77e295919ba0617ba /mesonbuild/compilers | |
parent | da1bb49787b2f65ca3a4c3c3fb0d9eda822f3275 (diff) | |
parent | 6e06ad1c1f3a0e02d70de2e5b66657ed08380c8f (diff) | |
download | meson-6253bbc6cc18f2850d924eac690338dcdf45a23b.zip meson-6253bbc6cc18f2850d924eac690338dcdf45a23b.tar.gz meson-6253bbc6cc18f2850d924eac690338dcdf45a23b.tar.bz2 |
Merge pull request #5039 from scivision/submod
BUGFIX: allow Fortran submodule to have same name as module
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/fortran.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index 15234ee..a16f2b5 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -180,7 +180,18 @@ class FortranCompiler(Compiler): return parameter_list def module_name_to_filename(self, module_name: str) -> str: - return module_name.lower() + '.mod' + if '_' in module_name: # submodule + s = module_name.lower() + if self.id in ('gcc', 'intel'): + filename = s.replace('_', '@') + '.smod' + elif self.id in ('pgi', 'flang'): + filename = s.replace('_', '-') + '.mod' + else: + filename = s + '.mod' + else: # module + filename = module_name.lower() + '.mod' + + return filename def get_std_shared_lib_link_args(self): return CCompiler.get_std_shared_lib_link_args(self) |