summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-15 22:50:56 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-23 21:47:29 -0400
commitfdd147a88e888e14fbd86b522998a8a566d09fd1 (patch)
tree8d5595608be83ad7fd32d1934fc3e70dfc412c53 /src
parent734005fe75777b5784033ee9ccbed6acd414b30f (diff)
meson: add dist-check-includes replacement
This is more-or-less the same as dist-check-includes. meson doesn't exactly make it easy to call a compiler with a custom set of options. The tests are included in the test listing.
Diffstat (limited to 'src')
-rw-r--r--src/systemd/meson.build25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/systemd/meson.build b/src/systemd/meson.build
index c7d7d50963..f3b969bb2b 100644
--- a/src/systemd/meson.build
+++ b/src/systemd/meson.build
@@ -1,6 +1,6 @@
# -*- mode: meson -*-
-systemd_headers = files('''
+_systemd_headers = '''
sd-bus.h
sd-bus-protocol.h
sd-bus-vtable.h
@@ -10,7 +10,10 @@ systemd_headers = files('''
sd-journal.h
sd-login.h
sd-messages.h
-'''.split())
+'''.split()
+
+# https://github.com/mesonbuild/meson/issues/1633
+systemd_headers = files(_systemd_headers)
# sd-device.h
# sd-hwdb.h
@@ -33,3 +36,21 @@ install_headers(
systemd_headers,
'_sd-common.h',
subdir : 'systemd')
+
+
+############################################################
+
+opts = [[],
+ ['-ansi'],
+ ['-std=iso9899:1990']]
+
+foreach header : _systemd_headers
+ foreach opt : opts
+ name = ''.join([header] + opt)
+ test('cc-' + name,
+ check_compilation_sh,
+ args : cc.cmd_array() + ['-x', 'c'] + opt +
+ ['-Werror', '-include',
+ join_paths(meson.current_source_dir(), header)])
+ endforeach
+endforeach