openfoam: expand 'make_fujitsu_rules' process for Ver.1812. (#20468)

This commit is contained in:
Tomoki, Karatsu 2020-12-27 21:41:37 +09:00 committed by GitHub
parent 0a241b2414
commit 95f63b506c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,11 +549,11 @@ def patch(self):
rcfile, rcfile,
backup=False) backup=False)
@when('@1906: %fj') @when('@1812: %fj')
@run_before('configure') @run_before('configure')
def make_fujitsu_rules(self): def make_fujitsu_rules(self):
"""Create Fujitsu rules (clang variant) unless supplied upstream. """Create Fujitsu rules (clang variant) unless supplied upstream.
Implemented for 1906 and later (older rules are too messy to edit). Implemented for 1812 and later (older rules are too messy to edit).
Already included after 1912. Already included after 1912.
""" """
general_rules = 'wmake/rules/General' general_rules = 'wmake/rules/General'
@ -574,13 +574,20 @@ def make_fujitsu_rules(self):
tty.info('Add Fujitsu wmake rules') tty.info('Add Fujitsu wmake rules')
copy_tree(src, dst) copy_tree(src, dst)
if self.spec.version >= Version('1906'):
for cfg in ['c', 'c++', 'general']: for cfg in ['c', 'c++', 'general']:
rule = join_path(dst, cfg) rule = join_path(dst, cfg)
filter_file('Clang', 'Fujitsu', rule, backup=False) filter_file('Clang', 'Fujitsu', rule, backup=False)
else:
filter_file('clang', spack_cc, join_path(dst, 'c'),
backup=False, string=True)
filter_file('clang++', spack_cxx, join_path(dst, 'c++'),
backup=False, string=True)
src = join_path(general_rules, 'Clang') src = join_path(general_rules, 'Clang')
dst = join_path(general_rules, 'Fujitsu') # self.compiler dst = join_path(general_rules, 'Fujitsu') # self.compiler
copy_tree(src, dst) copy_tree(src, dst)
if self.spec.version >= Version('1906'):
filter_file('clang', spack_cc, join_path(dst, 'c'), filter_file('clang', spack_cc, join_path(dst, 'c'),
backup=False, string=True) backup=False, string=True)
filter_file('clang++', spack_cxx, join_path(dst, 'c++'), filter_file('clang++', spack_cxx, join_path(dst, 'c++'),