Skip to content

Commit 04a7b68

Browse files
committed
Work around Meson bug ignoring c_std/cpp_std in subprojects
On Meson versions affected (or expected to be affected) by mesonbuild/meson#14939, add C and C++ languages to the root project so subprojects will respect c_std and cpp_std. We can adjust the version range if needed once the bug is fixed. There's probably some value in continuing to carry this check for a while after the fix is released, since developers might have older Meson versions on their machines.
1 parent 31e2c80 commit 04a7b68

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ project(
44
default_options: ['cpp_std=c++17'],
55
)
66

7+
if (
8+
meson.version().version_compare('<1.9.1') and
9+
meson.version().version_compare('>=1.8.4')
10+
)
11+
# ensure c_std= and cpp_std= are not ignored in subprojects
12+
# https://github.com/mesonbuild/meson/issues/14939
13+
add_languages(
14+
'c',
15+
'cpp',
16+
native: false,
17+
)
18+
endif
19+
720
wraps = get_option('wraps')
821

922
foreach w : wraps

0 commit comments

Comments
 (0)