xref: /openbmc/phosphor-networkd/src/meson.build (revision 93433c16)
1src_includes = include_directories('.')
2
3stdplus_dep = dependency('stdplus')
4
5executable(
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'),
15    stdplus_dep,
16  ],
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
29    json_dep = dependency('nlohmann_json')
30  endif
31endif
32
33networkd_deps = [
34  json_dep,
35  phosphor_dbus_interfaces_dep,
36  dependency('phosphor-logging'),
37  networkd_dbus_dep,
38  sdbusplus_dep,
39  dependency('sdeventplus'),
40  stdplus_dep,
41]
42
43conf_header = configure_file(
44  output: 'config.h',
45  configuration: conf_data)
46
47networkd_lib = static_library(
48  'networkd',
49  conf_header,
50  'ethernet_interface.cpp',
51  'neighbor.cpp',
52  'ipaddress.cpp',
53  'netlink.cpp',
54  'network_manager.cpp',
55  'system_configuration.cpp',
56  'system_queries.cpp',
57  'types.cpp',
58  'util.cpp',
59  'routing_table.cpp',
60  'config_parser.cpp',
61  'dhcp_configuration.cpp',
62  'vlan_interface.cpp',
63  'rtnetlink_server.cpp',
64  'dns_updater.cpp',
65  implicit_include_directories: false,
66  include_directories: src_includes,
67  dependencies: networkd_deps)
68
69networkd_dep = declare_dependency(
70  sources: conf_header,
71  dependencies: networkd_deps,
72  include_directories: src_includes,
73  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'))
82
83if (get_option('hyp-nw-config') == true)
84  subdir('ibm')
85endif
86