blob: ce1c14243bd919f2f39aa856a39c4b7d26bafec5 [file] [log] [blame]
William A. Kennington III1bbe3d12021-05-13 23:45:09 -07001src_includes = include_directories('.')
2
William A. Kennington IIIe7c5aaa2022-10-06 13:17:15 -07003stdplus_dep = dependency('stdplus')
William A. Kennington IIIa68ab4b2021-10-07 19:16:16 -07004
William A. Kennington III1bbe3d12021-05-13 23:45:09 -07005executable(
6 'ncsi-netlink',
7 'argument.cpp',
8 'ncsi_netlink_main.cpp',
9 'ncsi_util.cpp',
10 implicit_include_directories: false,
11 include_directories: src_includes,
12 dependencies: [
13 dependency('libnl-3.0'),
14 dependency('libnl-genl-3.0'),
William A. Kennington IIIe7c5aaa2022-10-06 13:17:15 -070015 stdplus_dep,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070016 ],
17 install: true,
18 install_dir: get_option('bindir'))
19
20json_dep = declare_dependency()
21if get_option('sync-mac')
22 # nlohmann_json might not have a pkg-config. It is header only so just make
23 # sure we can access the needed symbols from the header.
24 has_json = meson.get_compiler('cpp').has_header_symbol(
25 'nlohmann/json.hpp',
26 'nlohmann::json::string_t',
27 required: false)
28 if not has_json
Patrick Williams3397be32022-03-21 09:52:57 -050029 json_dep = dependency('nlohmann_json')
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070030 endif
31endif
32
33networkd_deps = [
34 json_dep,
35 phosphor_dbus_interfaces_dep,
William A. Kennington IIIe7c5aaa2022-10-06 13:17:15 -070036 dependency('phosphor-logging'),
William A. Kennington III37cf66c2021-05-17 14:56:54 -070037 networkd_dbus_dep,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070038 sdbusplus_dep,
Patrick Williams3397be32022-03-21 09:52:57 -050039 dependency('sdeventplus'),
William A. Kennington IIIe7c5aaa2022-10-06 13:17:15 -070040 stdplus_dep,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070041]
42
43conf_header = configure_file(
44 output: 'config.h',
45 configuration: conf_data)
46
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070047networkd_lib = static_library(
48 'networkd',
William A. Kennington III37cf66c2021-05-17 14:56:54 -070049 conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070050 'ethernet_interface.cpp',
51 'neighbor.cpp',
52 'ipaddress.cpp',
53 'netlink.cpp',
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070054 'network_manager.cpp',
William A. Kennington IIIa7344c32022-10-31 14:12:27 -070055 'rtnetlink.cpp',
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070056 'system_configuration.cpp',
William A. Kennington III2e09d272022-10-14 17:15:00 -070057 'system_queries.cpp',
William A. Kennington IIIbb0eacc2022-10-21 15:22:06 -070058 'types.cpp',
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070059 'util.cpp',
60 'routing_table.cpp',
61 'config_parser.cpp',
62 'dhcp_configuration.cpp',
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070063 'rtnetlink_server.cpp',
64 'dns_updater.cpp',
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070065 implicit_include_directories: false,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070066 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070067 dependencies: networkd_deps)
68
69networkd_dep = declare_dependency(
William A. Kennington III37cf66c2021-05-17 14:56:54 -070070 sources: conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070071 dependencies: networkd_deps,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070072 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070073 link_with: networkd_lib)
74
75executable(
76 'phosphor-network-manager',
77 'network_manager_main.cpp',
78 implicit_include_directories: false,
79 dependencies: networkd_dep,
80 install: true,
81 install_dir: get_option('bindir'))
Asmitha Karunanithibe2bdec2021-05-13 02:54:29 -050082
83if (get_option('hyp-nw-config') == true)
84 subdir('ibm')
85endif