Skip to content

Commit

Permalink
meson: fix order of compiler flags
Browse files Browse the repository at this point in the history
-Wall and -Wextra should be added before suppression flags
such as -Wno-unused-parameter
  • Loading branch information
MathieuDuponchelle authored and chouquette committed Oct 18, 2019
1 parent d608bd2 commit 87e6b72
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ mdns_micro_version = ver_arr[2]

cc = meson.get_compiler('c')

warning_flags = []

warning_flags = [
if cc.get_id() != 'msvc'
warning_flags += ['-Wall', '-Wextra']
endif

warning_flags += [
'-Wsign-compare',
'-Wstrict-aliasing',
'-Wstrict-overflow',
Expand All @@ -54,10 +59,6 @@ warning_flags = [
'-Wlogical-op',
]

if cc.get_id() != 'msvc'
warning_flags += ['-Wall', '-Wextra']
endif

add_project_arguments(cc.get_supported_arguments(warning_flags), language: 'c')

cdata = configuration_data()
Expand Down

0 comments on commit 87e6b72

Please sign in to comment.