From 71e8ad73b5afe4671da8103396cebc1e4fe6e4a5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 20 Jan 2025 13:11:00 -0500 Subject: Use "system" includes for dependencies and strengthen header test Things get confused when these flags differ across projects, so universally use "system" for external dependencies and test for header warnings only in the project that owns them. With this, we can remove all the suppressions that actually come from other projects and so can't be resolved here anyway. --- meson.build | 3 +++ test/headers/.clang-tidy | 2 +- test/headers/meson.build | 32 ++++---------------------------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/meson.build b/meson.build index d66a893..43b6c1d 100644 --- a/meson.build +++ b/meson.build @@ -122,18 +122,21 @@ m_dep = cc.find_library('m', required: false) serd_dep = dependency( 'serd-0', fallback: 'serd', + include_type: 'system', version: '>= 0.30.10', ) sord_dep = dependency( 'sord-0', fallback: 'sord', + include_type: 'system', version: '>= 0.16.16', ) lv2_dep = dependency( 'lv2', fallback: 'lv2', + include_type: 'system', version: '>= 1.18.4', ) diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy index aa1b43c..6f35b76 100644 --- a/test/headers/.clang-tidy +++ b/test/headers/.clang-tidy @@ -9,5 +9,5 @@ CheckOptions: - key: readability-function-cognitive-complexity.Threshold value: '0' WarningsAsErrors: '*' -HeaderFilterRegex: '.*/sratom/[^/]+.h' +HeaderFilterRegex: '.*' FormatStyle: file diff --git a/test/headers/meson.build b/test/headers/meson.build index 2e18a44..5320627 100644 --- a/test/headers/meson.build +++ b/test/headers/meson.build @@ -5,34 +5,10 @@ header_c_suppressions = [] if get_option('warning_level') == 'everything' if cc.get_id() == 'clang' - header_c_suppressions += [ - '-Wno-cast-align', # LV2 - '-Wno-cast-qual', # LV2 - '-Wno-declaration-after-statement', # LV2 - '-Wno-documentation-unknown-command', # LV2 - '-Wno-padded', # LV2, serd - '-Wno-poison-system-directories', - '-Wno-unsafe-buffer-usage', # LV2 - ] - elif cc.get_id() == 'gcc' - header_c_suppressions += [ - '-Wno-cast-align', # LV2 - '-Wno-cast-qual', # LV2 - '-Wno-padded', # Serd - '-Wno-sign-conversion', # LV2 - '-Wno-unused-const-variable', # Serd - ] - elif cc.get_id() == 'msvc' - header_c_suppressions += [ - '/wd4820', # padding added after construct - ] - endif -endif - -if cc.get_id() == 'clang' - header_c_suppressions += [ - '-Wno-nullability-extension', - ] + if not meson.is_cross_build() + c_suppressions += ['-Wno-poison-system-directories'] + endif + endif endif header_c_suppressions = cc.get_supported_arguments(header_c_suppressions) -- cgit v1.2.1