diff options
author | David Robillard <d@drobilla.net> | 2022-12-10 14:51:34 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-11 13:15:02 -0500 |
commit | 86e5e821531ff563b7e4642aa792d9e0f3067557 (patch) | |
tree | 8c637653d8222471309f762eb36bc774f62a8fc2 /test/headers/meson.build | |
parent | d102b7df35d900d568e49e640a5331f283717737 (diff) | |
download | lv2-86e5e821531ff563b7e4642aa792d9e0f3067557.tar.xz |
Test headers for warnings more strictly
Diffstat (limited to 'test/headers/meson.build')
-rw-r--r-- | test/headers/meson.build | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/headers/meson.build b/test/headers/meson.build new file mode 100644 index 0000000..e0a2d76 --- /dev/null +++ b/test/headers/meson.build @@ -0,0 +1,53 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: 0BSD OR ISC + +header_c_suppressions = [] + +if get_option('strict') + if cc.get_id() == 'clang' + header_c_suppressions += [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-declaration-after-statement', + '-Wno-padded', + ] + + elif cc.get_id() == 'gcc' + header_c_suppressions += [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-padded', + '-Wno-sign-conversion', + '-Wno-suggest-attribute=format', + '-Wno-unused-const-variable', + ] + + if host_machine.system() == 'windows' + header_c_suppressions += [ + '-Wno-sign-conversion', + ] + endif + + 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', + ] +endif + +test( + 'headers', + executable( + 'test_headers', + files('test_headers.c'), + c_args: header_c_suppressions, + dependencies: [lv2_dep], + ), + suite: 'unit', +) |