From 4020bc9376eb77d8b6493d98bf9dc6c5b03e41dc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 20 Jan 2025 13:16:57 -0500 Subject: Use "system" include type for all dependencies and add 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. --- .clang-tidy | 1 - NEWS | 6 ++++++ bindings/python/conf.py | 4 ++-- bindings/python/lilv.py | 2 +- doc/lv2apply.1 | 4 ++-- doc/lv2bench.1 | 4 ++-- doc/lv2info.1 | 4 ++-- doc/lv2ls.1 | 4 ++-- meson.build | 37 +++++++++++++++++++++++++++++++------ src/lilv_config.h | 2 +- test/headers/.clang-tidy | 15 +++++++++++++++ test/headers/meson.build | 27 +++++++++++++++++++++++++++ test/headers/test_headers.c | 13 +++++++++++++ test/meson.build | 6 ++++++ tools/meson.build | 3 ++- 15 files changed, 112 insertions(+), 20 deletions(-) create mode 100644 test/headers/.clang-tidy create mode 100644 test/headers/meson.build create mode 100644 test/headers/test_headers.c diff --git a/.clang-tidy b/.clang-tidy index b695c4f..54e9bd6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,7 +3,6 @@ Checks: > *, - -*-macro-to-enum, -*-vararg, -altera-*, -bugprone-assignment-in-if-condition, diff --git a/NEWS b/NEWS index 122b3f7..bac5b41 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +lilv (0.24.27) unstable; urgency=medium + + * Add header warnings test + + -- David Robillard Mon, 20 Jan 2025 18:14:00 +0000 + lilv (0.24.26) stable; urgency=medium * Add lint option with project metadata and code quality tests diff --git a/bindings/python/conf.py b/bindings/python/conf.py index fe62410..4fc0911 100644 --- a/bindings/python/conf.py +++ b/bindings/python/conf.py @@ -60,9 +60,9 @@ copyright = u'2016, David Robillard' # built documents. # # The short X.Y version. -version = '0.24.26' +version = '0.24.27' # The full version, including alpha/beta/rc tags. -release = '0.24.26' +release = '0.24.27' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py index a12f94f..100b3d1 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -6,7 +6,7 @@ __author__ = "David Robillard" __copyright__ = "Copyright 2016-2024 David Robillard" __license__ = "ISC" -__version__ = "0.24.26" +__version__ = "0.24.27" __maintainer__ = "David Robillard" __email__ = "d@drobilla.net" __status__ = "Production" diff --git a/doc/lv2apply.1 b/doc/lv2apply.1 index bcc49ba..aaf0985 100644 --- a/doc/lv2apply.1 +++ b/doc/lv2apply.1 @@ -1,8 +1,8 @@ .\" # Copyright 2010-2024 David Robillard .\" # SPDX-License-Identifier: ISC -.Dd Nov 29, 2022 +.Dd January 20, 2025 .Dt LV2APPLY 1 -.Os Lilv 0.24.26 +.Os Lilv 0.24.27 .Sh NAME .Nm lv2apply .Nd apply an LV2 plugin to an audio file diff --git a/doc/lv2bench.1 b/doc/lv2bench.1 index 5f87e6b..4c46914 100644 --- a/doc/lv2bench.1 +++ b/doc/lv2bench.1 @@ -1,8 +1,8 @@ .\" # Copyright 2024 David Robillard .\" # SPDX-License-Identifier: ISC -.Dd Nov 29, 2022 +.Dd January 20, 2025 .Dt LV2BENCH 1 -.Os Lilv 0.24.26 +.Os Lilv 0.24.27 .Sh NAME .Nm lv2bench .Nd benchmark all installed and supported LV2 plugins diff --git a/doc/lv2info.1 b/doc/lv2info.1 index d8950d2..72b7bd2 100644 --- a/doc/lv2info.1 +++ b/doc/lv2info.1 @@ -1,8 +1,8 @@ .\" # Copyright 2009-2024 David Robillard .\" # SPDX-License-Identifier: ISC -.Dd Nov 29, 2022 +.Dd January 20, 2025 .Dt LV2INFO 1 -.Os Lilv 0.24.26 +.Os Lilv 0.24.27 .Sh NAME .Nm lv2info .Nd print information about an installed LV2 plugin diff --git a/doc/lv2ls.1 b/doc/lv2ls.1 index 5b13243..1862ac1 100644 --- a/doc/lv2ls.1 +++ b/doc/lv2ls.1 @@ -1,8 +1,8 @@ .\" # Copyright 2010-2024 David Robillard .\" # SPDX-License-Identifier: ISC -.Dd Nov 29, 2022 +.Dd January 20, 2025 .Dt LV2LS 1 -.Os Lilv 0.24.26 +.Os Lilv 0.24.27 .Sh NAME .Nm lv2ls .Nd list all installed LV2 plugins diff --git a/meson.build b/meson.build index d5bc4e9..4379e0d 100644 --- a/meson.build +++ b/meson.build @@ -12,7 +12,7 @@ project( ], license: 'ISC', meson_version: '>= 0.56.0', - version: '0.24.26', + version: '0.24.27', ) lilv_src_root = meson.current_source_dir() @@ -220,11 +220,36 @@ add_project_arguments(platform_defines, language: ['c']) m_dep = cc.find_library('m', required: false) dl_dep = cc.find_library('dl', required: false) -zix_dep = dependency('zix-0', fallback: 'zix', version: '>= 0.6.0') -serd_dep = dependency('serd-0', fallback: 'serd', version: '>= 0.30.10') -sord_dep = dependency('sord-0', fallback: 'sord', version: '>= 0.16.16') -lv2_dep = dependency('lv2', fallback: 'lv2', version: '>= 1.18.2') -sratom_dep = dependency('sratom-0', fallback: 'sratom', version: '>= 0.6.10') +zix_dep = dependency( + 'zix-0', + include_type: 'system', + fallback: 'zix', + version: '>= 0.6.0', +) +serd_dep = dependency( + 'serd-0', + include_type: 'system', + fallback: 'serd', + version: '>= 0.30.10', +) +sord_dep = dependency( + 'sord-0', + include_type: 'system', + fallback: 'sord', + version: '>= 0.16.16', +) +lv2_dep = dependency( + 'lv2', + include_type: 'system', + fallback: 'lv2', + version: '>= 1.18.2', +) +sratom_dep = dependency( + 'sratom-0', + include_type: 'system', + fallback: 'sratom', + version: '>= 0.6.10', +) ########### # Library # diff --git a/src/lilv_config.h b/src/lilv_config.h index 467ab3d..1198ce2 100644 --- a/src/lilv_config.h +++ b/src/lilv_config.h @@ -5,7 +5,7 @@ #define LILV_CONFIG_H // Define version unconditionally so a warning will catch a mismatch -#define LILV_VERSION "0.24.26" +#define LILV_VERSION "0.24.27" // Separator between entries in variables like PATH #ifndef LILV_PATH_SEP diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy new file mode 100644 index 0000000..a42a718 --- /dev/null +++ b/test/headers/.clang-tidy @@ -0,0 +1,15 @@ +# Copyright 2020-2024 David Robillard +# SPDX-License-Identifier: 0BSD OR ISC + +Checks: > + *, + -altera-*, + -llvmlibc-*, +CheckOptions: + - key: readability-function-cognitive-complexity.Threshold + value: '1' + - key: readability-identifier-length.IgnoredParameterNames + value: '^(a)|(b)|(ui)|(i)$' +WarningsAsErrors: '*' +HeaderFilterRegex: '.*' +FormatStyle: file diff --git a/test/headers/meson.build b/test/headers/meson.build new file mode 100644 index 0000000..4415de1 --- /dev/null +++ b/test/headers/meson.build @@ -0,0 +1,27 @@ +# Copyright 2020-2025 David Robillard +# SPDX-License-Identifier: 0BSD OR ISC + +header_c_suppressions = [] + +if get_option('warning_level') == 'everything' + if cc.get_id() == 'clang' + if not meson.is_cross_build() + header_c_suppressions += ['-Wno-poison-system-directories'] + endif + endif +endif + +if cc.get_id() == 'clang' + header_c_suppressions += ['-Wno-nullability-extension'] +endif + +test( + 'headers', + executable( + 'test_headers', + files('test_headers.c'), + c_args: header_c_suppressions, + dependencies: lilv_dep, + ), + suite: 'unit', +) diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c new file mode 100644 index 0000000..b0d4aa5 --- /dev/null +++ b/test/headers/test_headers.c @@ -0,0 +1,13 @@ +// Copyright 2022-2025 David Robillard +// SPDX-License-Identifier: ISC + +#include // IWYU pragma: keep + +#ifdef __GNUC__ +__attribute__((const)) +#endif +int +main(void) +{ + return 0; +} diff --git a/test/meson.build b/test/meson.build index e260f37..eec78b5 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,6 +1,12 @@ # Copyright 2020-2022 David Robillard # SPDX-License-Identifier: 0BSD OR ISC +################### +# Header Warnings # +################### + +subdir('headers') + ############## # Test Setup # ############## diff --git a/tools/meson.build b/tools/meson.build index ee35378..2338cc1 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -38,8 +38,9 @@ install_data( sndfile_dep = dependency( 'sndfile', - version: '>= 1.0.0', + include_type: 'system', required: get_option('tools'), + version: '>= 1.0.0', ) if sndfile_dep.found() -- cgit v1.2.1