Honor global compiler flags (#23305)

This commit is contained in:
Chris White 2021-04-28 12:11:19 -07:00 committed by GitHub
parent 51509dbad0
commit c8084991b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,13 +299,22 @@ def configure_args(self):
extra_args.append('--enable-static-exec')
if '+pic' in self.spec:
extra_args.extend([
'CFLAGS=' + self.compiler.cc_pic_flag,
'CXXFLAGS=' + self.compiler.cxx_pic_flag,
'FCFLAGS=' + self.compiler.fc_pic_flag,
])
# use global spack compiler flags
_flags = self.compiler.cc_pic_flag
_flags += " " + ' '.join(self.spec.compiler_flags['cflags'])
extra_args.append('CFLAGS={0}'.format(_flags))
# Fujitsu Compiler dose not add Fortran runtime in rpath.
if '+cxx' in self.spec:
_flags = self.compiler.cxx_pic_flag
_flags += " " + ' '.join(self.spec.compiler_flags['cxxflags'])
extra_args.append('CXXFLAGS={0}'.format(_flags))
if '+fortran' in self.spec:
_flags = self.compiler.fc_pic_flag
_flags += " " + ' '.join(self.spec.compiler_flags['fflags'])
extra_args.append('FCFLAGS={0}'.format(_flags))
# Fujitsu Compiler does not add Fortran runtime in rpath.
if '+fortran %fj' in self.spec:
extra_args.append('LDFLAGS=-lfj90i -lfj90f -lfjsrcinfo -lelf')