Skip to content

Commit 26696e2

Browse files
authored
Merge pull request scipy#21917 from rgommers/fix-fortranstd-legacy
BLD: fortran: only use `-std=legacy` for gfortran
2 parents 2e04473 + 8659c64 commit 26696e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ project(
99
'b_ndebug=if-release',
1010
'c_std=c17',
1111
'cpp_std=c++17',
12-
'fortran_std=legacy',
1312
'blas=openblas',
1413
'lapack=openblas'
1514
],
@@ -80,6 +79,13 @@ endif
8079
# Adding at project level causes many spurious -lgfortran flags.
8180
add_languages('fortran', native: false)
8281
ff = meson.get_compiler('fortran')
82+
if ff.get_id() == 'gcc'
83+
# -std=legacy is not supported by all Fortran compilers, but very useful with
84+
# gfortran since it avoids a ton of warnings that we don't care about.
85+
# Needs fixing in Meson, see https://github.com/mesonbuild/meson/issues/11633.
86+
add_project_arguments('-std=legacy', language: 'fortran')
87+
endif
88+
8389
if ff.has_argument('-Wno-conversion')
8490
add_project_arguments('-Wno-conversion', language: 'fortran')
8591
endif

0 commit comments

Comments
 (0)