python: use CFLAGS=-fp-model=strict with %oneapi (#23575)

This commit is contained in:
Davide Mancusi 2021-05-13 13:04:21 +02:00 committed by GitHub
parent a4f03dba9c
commit 9a71bd3893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,6 +383,7 @@ def flag_handler(self, name, flags):
def configure_args(self):
spec = self.spec
config_args = []
cflags = []
# setup.py needs to be able to read the CPPFLAGS and LDFLAGS
# as it scans for the library and headers to build
@ -444,7 +445,7 @@ def configure_args(self):
config_args.append('--without-ensurepip')
if '+pic' in spec:
config_args.append('CFLAGS={0}'.format(self.compiler.cc_pic_flag))
cflags.append(self.compiler.cc_pic_flag)
if '+ssl' in spec:
if spec.satisfies('@3.7:'):
@ -479,6 +480,12 @@ def configure_args(self):
if spec.satisfies('@3.2: +sqlite3'):
config_args.append('--enable-loadable-sqlite-extensions')
if spec.satisfies('%oneapi'):
cflags.append('-fp-model=strict')
if cflags:
config_args.append('CFLAGS={0}'.format(' '.join(cflags)))
return config_args
@run_after('install')