]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/meson.build
tree-wide: beautify remaining copyright statements
[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_headers = '''
6 sd-bus.h
7 sd-bus-protocol.h
8 sd-bus-vtable.h
9 sd-daemon.h
10 sd-event.h
11 sd-id128.h
12 sd-journal.h
13 sd-login.h
14 sd-messages.h
15 '''.split()
16
17 # https://github.com/mesonbuild/meson/issues/1633
18 systemd_headers = files(_systemd_headers)
19
20 # sd-device.h
21 # sd-hwdb.h
22 # sd-dhcp6-client.h
23 # sd-dhcp6-lease.h
24 # sd-dhcp-client.h
25 # sd-dhcp-lease.h
26 # sd-dhcp-server.h
27 # sd-ipv4acd.h
28 # sd-ipv4ll.h
29 # sd-lldp.h
30 # sd-ndisc.h
31 # sd-netlink.h
32 # sd-network.h
33 # sd-path.h
34 # sd-resolve.h
35 # sd-utf8.h
36
37 install_headers(
38 systemd_headers,
39 '_sd-common.h',
40 subdir : 'systemd')
41
42
43 ############################################################
44
45 opts = [['c'],
46 ['c', '-ansi'],
47 ['c', '-std=iso9899:1990'],
48 ['c', '-std=iso9899:2011']]
49
50 if cc.has_argument('-std=iso9899:2017')
51 opts += [['c', '-std=iso9899:2017']]
52 endif
53
54 cxx = find_program('c++', required : false)
55 if cxx.found()
56 opts += [['c++'],
57 ['c++', '-std=c++98'],
58 ['c++', '-std=c++11']]
59 if cc.has_argument('-std=c++14')
60 opts += [['c++', '-std=c++14']]
61 endif
62 if cc.has_argument('-std=c++17')
63 opts += [['c++', '-std=c++17']]
64 endif
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