Skip to content

Commit 03c86db

Browse files
committed
MAINT,BUG: Correctly skip distutils options
1 parent 6f428f2 commit 03c86db

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

numpy/f2py/f2py2e.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,13 @@ def run_compile():
635635
r'--((f(90)?compiler(-exec|)|compiler)=|help-compiler)')
636636
flib_flags = [_m for _m in sys.argv[1:] if _reg3.match(_m)]
637637
sys.argv = [_m for _m in sys.argv if _m not in flib_flags]
638-
_reg4 = re.compile(
639-
r'--((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help-fcompiler))')
640-
fc_flags = [_m for _m in sys.argv[1:] if _reg4.match(_m)]
641-
sys.argv = [_m for _m in sys.argv if _m not in fc_flags]
638+
reg_f77_f90_flags = re.compile(r'--f(77|90)flags=')
639+
reg_distutils_flags = re.compile(r'--((f(77|90)exec|opt|arch)=|(debug|noopt|noarch|help-fcompiler))')
640+
fc_flags = [_m for _m in sys.argv[1:] if reg_f77_f90_flags.match(_m)]
641+
distutils_flags = [_m for _m in sys.argv[1:] if reg_distutils_flags.match(_m)]
642+
if not (MESON_ONLY_VER or backend_key == 'meson'):
643+
fc_flags.extend(distutils_flags)
644+
sys.argv = [_m for _m in sys.argv if _m not in (fc_flags + distutils_flags)]
642645

643646
del_list = []
644647
for s in flib_flags:

0 commit comments

Comments
 (0)