summaryrefslogtreecommitdiff
path: root/tests/use-as-subproject/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-10-10 14:08:54 +0100
committerSimon McVittie <smcv@collabora.com>2022-10-10 14:09:29 +0100
commit45108f1852d329b3a4d10f6d5d3558dca8288dcb (patch)
treeb1ed96ebcf090c0afcd1759cf8e7fecd0a8274cb /tests/use-as-subproject/meson.build
parentf780507d5b92005df725ab9b24cf0b23dd9d9bb5 (diff)
downloadlibglnx-45108f1852d329b3a4d10f6d5d3558dca8288dcb.tar.gz
build: Explicitly disable warnings for non-ISO C features
libglnx is intentionally not portable to non-Unix platforms or to compilers that do not implement gcc/clang extensions, so it's counterproductive to warn about these extensions, even if libglnx is used by a parent project that generally (for the parts that don't use libglnx) wants to be portable to any ISO C compiler. Suggested by Will Thompson on !36. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'tests/use-as-subproject/meson.build')
-rw-r--r--tests/use-as-subproject/meson.build28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/use-as-subproject/meson.build b/tests/use-as-subproject/meson.build
index 2d08160..59fd736 100644
--- a/tests/use-as-subproject/meson.build
+++ b/tests/use-as-subproject/meson.build
@@ -4,6 +4,10 @@
project(
'use-libglnx-as-subproject',
'c',
+ default_options : [
+ 'c_std=gnu99',
+ 'warning_level=3',
+ ],
version : '0',
meson_version : '>=0.49.0',
)
@@ -20,5 +24,25 @@ libglnx = subproject('libglnx')
libglnx_dep = libglnx.get_variable('libglnx_dep')
libglnx_testlib_dep = libglnx.get_variable('libglnx_testlib_dep')
-executable('use-libglnx', 'use-libglnx.c', dependencies : [libglnx_dep, glib_dep])
-executable('use-testlib', 'use-testlib.c', dependencies : [libglnx_testlib_dep, glib_dep])
+# This executable is compiled at warning_level=3 by default
+executable(
+ 'trivial',
+ 'trivial.c',
+ dependencies : [glib_dep],
+)
+
+# These can't be compiled at warning_level=3 because they use non-ISO
+# compiler features in the libglnx headers, which would be warnings or
+# errors with -Wpedantic
+executable(
+ 'use-libglnx',
+ 'use-libglnx.c',
+ dependencies : [libglnx_dep, glib_dep],
+ override_options : ['warning_level=2'],
+)
+executable(
+ 'use-testlib',
+ 'use-testlib.c',
+ dependencies : [libglnx_testlib_dep, glib_dep],
+ override_options : ['warning_level=2'],
+)