blob: f227b1ab45fb90b2b01ee05ea991744e5786e001 [file] [log] [blame]
William A. Kennington III0a01b2a2021-05-13 18:38:57 -07001project(
2 'phosphor-networkd',
3 'cpp',
4 version: '0.1',
5 meson_version: '>=0.57.0',
6 default_options: [
7 'warning_level=3',
8 'cpp_std=c++20',
9 ])
10
William A. Kennington III1e710d02021-05-24 13:35:44 -070011default_busname = 'xyz.openbmc_project.Network'
12
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070013conf_data = configuration_data()
William A. Kennington III1e710d02021-05-24 13:35:44 -070014conf_data.set_quoted('DEFAULT_BUSNAME', default_busname)
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070015conf_data.set('HAVE_UBOOT_ENV', get_option('uboot-env'))
16conf_data.set(
17 'LINK_LOCAL_AUTOCONFIGURATION',
18 get_option('default-link-local-autoconf'))
19conf_data.set(
20 'ENABLE_IPV6_ACCEPT_RA',
21 get_option('default-ipv6-accept-ra'))
22conf_data.set('NIC_SUPPORTS_ETHTOOL', get_option('nic-ethtool'))
23conf_data.set('SYNC_MAC_FROM_INVENTORY', get_option('sync-mac'))
Johnathan Mantey609c12d2022-02-03 09:23:09 -080024conf_data.set('PERSIST_MAC', get_option('persist-mac'))
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070025
Patrick Williams3397be32022-03-21 09:52:57 -050026sdbusplus_dep = dependency('sdbusplus')
27sdbusplusplus_prog = find_program('sdbus++', native: true)
28sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070029
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070030generated_sources = []
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070031generated_others = []
32yaml_sources = []
33subdir('gen')
34subdir('gen/xyz')
William A. Kennington III37cf66c2021-05-17 14:56:54 -070035networkd_dbus_includes = include_directories('gen')
36
Patrick Williams3397be32022-03-21 09:52:57 -050037phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
William A. Kennington III37cf66c2021-05-17 14:56:54 -070038
39networkd_dbus_deps = [
40 phosphor_dbus_interfaces_dep,
41 sdbusplus_dep,
42]
43
44networkd_dbus_lib = static_library(
45 'networkd_dbus',
46 generated_sources,
47 implicit_include_directories: false,
48 include_directories: networkd_dbus_includes,
49 dependencies: networkd_dbus_deps)
50
51generated_files_headers = []
52foreach s : generated_sources
53 foreach f : s.to_list()
54 p = f.full_path()
55 if p.endswith('.hpp')
56 generated_files_headers += f
57 endif
58 endforeach
59endforeach
60
61networkd_dbus_dep = declare_dependency(
62 sources: generated_files_headers,
63 include_directories: networkd_dbus_includes,
64 link_with: networkd_dbus_lib,
65 dependencies: networkd_dbus_deps)
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070066
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070067subdir('src')
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070068
69configure_file(
70 input: 'xyz.openbmc_project.Network.service.in',
71 output: 'xyz.openbmc_project.Network.service',
William A. Kennington III1e710d02021-05-24 13:35:44 -070072 configuration: {
73 'SYSTEMD_TARGET': 'multi-user.target',
74 'DEFAULT_BUSNAME': default_busname,
75 },
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070076 install: true,
77 install_dir: dependency('systemd').get_variable(
78 pkgconfig: 'systemdsystemunitdir'))
79
80configure_file(
81 input: 'xyz.openbmc_project.Network.conf.in',
82 output: 'xyz.openbmc_project.Network.conf',
William A. Kennington III1e710d02021-05-24 13:35:44 -070083 configuration: {'DEFAULT_BUSNAME': default_busname},
William A. Kennington III0a01b2a2021-05-13 18:38:57 -070084 install: true,
85 install_dir: get_option('datadir') / 'dbus-1' / 'system.d')
86
87if not get_option('tests').disabled()
88 subdir('test')
89endif