molden: fix build with gcc@10: (#25803)

This commit is contained in:
Nisarg Patel 2021-10-05 03:36:20 +02:00 committed by GitHub
parent 84c878b66a
commit b5673d70de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,9 +52,6 @@ def edit(self, spec, prefix):
cflags = '-O2 -funroll-loops'
fflags = cflags
if '%gcc@10:' in self.spec:
fflags += '-fallow-argument-mismatch'
makefile.filter(r'CFLAGS = (.*)', r'CFLAGS = {0} \1'.format(cflags))
makefile.filter(r'FFLAGS = (.*)', r'FFLAGS = {0} \1'.format(fflags))
@ -62,5 +59,13 @@ def edit(self, spec, prefix):
makefile.filter(r'AFLAG=*', r'AFLAG=')
makefile.filter(r'rm -f src/', r'rm -f ')
def flag_handler(self, name, flags):
if name == 'fflags':
if self.spec.satisfies('%gcc@10:'):
if flags is None:
flags = []
flags.append('-fallow-argument-mismatch')
return (flags, None, None)
def install(self, spec, prefix):
install_tree('bin', prefix.bin)