aboutsummaryrefslogtreecommitdiffstats
path: root/examples/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'examples/meson.build')
-rw-r--r--examples/meson.build57
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