diff options
author | David Robillard <d@drobilla.net> | 2021-05-28 16:25:52 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-05-28 17:26:38 -0400 |
commit | 55f9506e4fe172cd5376ad9d95a99440a90b3c43 (patch) | |
tree | 3da847c441e1020528e49feddd7ea3c77e645fc3 /examples | |
parent | 3342e618b59e8c35f387bb27153fccf141670ef9 (diff) | |
download | pugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.tar.gz pugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.tar.bz2 pugl-55f9506e4fe172cd5376ad9d95a99440a90b3c43.zip |
Split up warning suppression flags more finely
This avoids polluting the main list of suppressions with things that are only
triggered in tests or examples, making it clearer which warning are present in
pugl itself.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/meson.build | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/examples/meson.build b/examples/meson.build index be4091a..6984033 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,5 +1,5 @@ data_dir = get_option('prefix') / get_option('datadir') / 'pugl-0' -example_args = ['-DPUGL_DATA_DIR="@0@"'.format(data_dir)] +example_defines = ['-DPUGL_DATA_DIR="@0@"'.format(data_dir)] gl_examples = [ 'pugl_cpp_demo.cpp', @@ -24,6 +24,51 @@ includes = include_directories( '../include', ) +# Suppress some additional C warnings in examples +example_c_args = [] +if get_option('strict') + if cc.get_id() == 'clang' + example_c_args += [ + '-Wno-float-equal', + '-Wno-padded', + ] + elif cc.get_id() == 'gcc' + example_c_args += [ + '-Wno-float-equal', + '-Wno-padded', + ] + endif + + example_c_args = cc.get_supported_arguments(example_c_args) +endif + +# Suppress some additional C++ warnings in examples +example_cpp_args = [] +if is_variable('cpp') + if cpp.get_id() == 'clang' + example_cpp_args += [ + '-Wno-documentation', # Cairo + '-Wno-documentation-unknown-command', # Cairo + '-Wno-old-style-cast', + '-Wno-padded', + '-Wno-reserved-id-macro', + '-Wno-switch-enum', + ] + elif cpp.get_id() == 'gcc' + example_cpp_args += [ + '-Wno-effc++', + '-Wno-old-style-cast', + '-Wno-padded', + '-Wno-switch-default', + '-Wno-switch-enum', + '-Wno-unused-const-variable', + '-Wno-useless-cast', + ] + endif + + example_cpp_args = cpp.get_supported_arguments(example_cpp_args) +endif + subdir('shaders') # Build GL examples @@ -42,8 +87,8 @@ if opengl_dep.found() executable(target, source, include_directories: includes, - c_args: example_args, - cpp_args: example_args, + c_args: example_defines + example_c_args, + cpp_args: example_defines + example_cpp_args, dependencies: dependencies) endforeach endif @@ -54,7 +99,7 @@ if cairo_dep.found() target = example.split('.')[0] executable(target, example, include_directories: includes, - c_args: example_args, + c_args: example_defines + example_c_args, dependencies: [pugl_dep, cairo_backend_dep]) endforeach endif @@ -72,8 +117,8 @@ if vulkan_dep.found() executable(target, source, include_directories: includes, - c_args: example_args, - cpp_args: example_args, + c_args: example_defines + example_c_args, + cpp_args: example_defines + example_cpp_args, dependencies: dependencies) endforeach endif |