Skip to content

Commit f18bc29

Browse files
emersionkennylevinsen
authored andcommitted
build: use cc.get_supported_arguments() for warnings
Let's not require the C compiler to support specific warnings, especially if half the flags are used to turn off the warnings anyways.
1 parent 0b10244 commit f18bc29

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

meson.build

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ project(
1111
],
1212
)
1313

14-
add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
14+
cc = meson.get_compiler('c')
1515

16-
add_project_arguments(
17-
[
18-
'-Wno-unused-parameter',
19-
'-Wno-unused-result',
20-
'-Wundef',
21-
'-Wvla',
22-
],
23-
language: 'c',
24-
)
16+
add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
2517

26-
cc = meson.get_compiler('c')
18+
add_project_arguments(cc.get_supported_arguments([
19+
'-Wno-unused-parameter',
20+
'-Wno-unused-result',
21+
'-Wundef',
22+
'-Wvla',
23+
]), language: 'c')
2724

2825
is_freebsd = host_machine.system().startswith('freebsd')
29-
3026
if is_freebsd
3127
add_project_arguments('-D_C11_SOURCE', language: 'c')
3228
endif

0 commit comments

Comments
 (0)