]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/meson.build
license: LGPL-2.1+ -> LGPL-2.1-or-later
[thirdparty/systemd.git] / src / systemd / meson.build
CommitLineData
db9ecf05 1# SPDX-License-Identifier: LGPL-2.1-or-later
3a726fcd 2
fdd147a8 3_systemd_headers = '''
37efbbd8
ZJS
4 sd-bus.h
5 sd-bus-protocol.h
6 sd-bus-vtable.h
7 sd-daemon.h
3f608087 8 sd-device.h
37efbbd8 9 sd-event.h
6083c4b7 10 sd-hwdb.h
37efbbd8
ZJS
11 sd-id128.h
12 sd-journal.h
13 sd-login.h
14 sd-messages.h
557afad2 15 sd-path.h
fdd147a8
ZJS
16'''.split()
17
18# https://github.com/mesonbuild/meson/issues/1633
19systemd_headers = files(_systemd_headers)
5c23128d 20
d6263ee4
YW
21_not_installed_headers = '''
22 sd-dhcp6-client.h
23 sd-dhcp6-lease.h
24 sd-dhcp-client.h
25 sd-dhcp-lease.h
461dbb2f 26 sd-dhcp-option.h
99ccb8ff 27 sd-dhcp6-option.h
d6263ee4
YW
28 sd-dhcp-server.h
29 sd-ipv4acd.h
30 sd-ipv4ll.h
31 sd-lldp.h
32 sd-ndisc.h
33 sd-netlink.h
34 sd-network.h
d6263ee4 35 sd-radv.h
35f2cb28 36 sd-resolve.h
d6263ee4
YW
37 sd-utf8.h
38'''.split()
39
37ab1a25 40install_headers(
37efbbd8
ZJS
41 systemd_headers,
42 '_sd-common.h',
43 subdir : 'systemd')
fdd147a8
ZJS
44
45
46############################################################
47
d7f149c1
ZJS
48opts = [['c'],
49 ['c', '-ansi'],
aeaac7b5
ZJS
50 ['c', '-std=iso9899:1990'],
51 ['c', '-std=iso9899:2011']]
52
53if cc.has_argument('-std=iso9899:2017')
54 opts += [['c', '-std=iso9899:2017']]
55endif
ec36d052 56
46e63a2a 57if add_languages('cpp', required : false)
aeaac7b5
ZJS
58 opts += [['c++'],
59 ['c++', '-std=c++98'],
60 ['c++', '-std=c++11']]
61 if cc.has_argument('-std=c++14')
62 opts += [['c++', '-std=c++14']]
63 endif
64 if cc.has_argument('-std=c++17')
65 opts += [['c++', '-std=c++17']]
66 endif
ec36d052 67endif
fdd147a8 68
76281c64 69foreach header : _systemd_headers + _not_installed_headers + ['../libudev/libudev.h']
37efbbd8 70 foreach opt : opts
76281c64 71 name = ''.join(['cc-', header.split('/')[-1], ':'] + opt)
938be089 72 if want_tests != 'false'
76281c64 73 test(name,
938be089
ZJS
74 check_compilation_sh,
75 args : cc.cmd_array() + ['-c', '-x'] + opt +
76 ['-Werror', '-include',
77 join_paths(meson.current_source_dir(), header)])
78 endif
37efbbd8 79 endforeach
fdd147a8 80endforeach