]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/meson.build
Merge pull request #6918 from ssahani/issue-5625
[thirdparty/systemd.git] / src / systemd / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
4 #
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9 #
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 _systemd_headers = '''
19 sd-bus.h
20 sd-bus-protocol.h
21 sd-bus-vtable.h
22 sd-daemon.h
23 sd-event.h
24 sd-id128.h
25 sd-journal.h
26 sd-login.h
27 sd-messages.h
28 '''.split()
29
30 # https://github.com/mesonbuild/meson/issues/1633
31 systemd_headers = files(_systemd_headers)
32
33 # sd-device.h
34 # sd-hwdb.h
35 # sd-dhcp6-client.h
36 # sd-dhcp6-lease.h
37 # sd-dhcp-client.h
38 # sd-dhcp-lease.h
39 # sd-dhcp-server.h
40 # sd-ipv4acd.h
41 # sd-ipv4ll.h
42 # sd-lldp.h
43 # sd-ndisc.h
44 # sd-netlink.h
45 # sd-network.h
46 # sd-path.h
47 # sd-resolve.h
48 # sd-utf8.h
49
50 install_headers(
51 systemd_headers,
52 '_sd-common.h',
53 subdir : 'systemd')
54
55
56 ############################################################
57
58 opts = [['c'],
59 ['c', '-ansi'],
60 ['c', '-std=iso9899:1990']]
61
62 cxx = find_program('c++', required : false)
63 if cxx.found()
64 opts += [['c++']]
65 endif
66
67 foreach header : _systemd_headers
68 foreach opt : opts
69 name = ''.join([header, ':'] + opt)
70 test('cc-' + name,
71 check_compilation_sh,
72 args : cc.cmd_array() + ['-c', '-x'] + opt +
73 ['-Werror', '-include',
74 join_paths(meson.current_source_dir(), header)])
75 endforeach
76 endforeach