xref: /openbmc/phosphor-networkd/src/meson.build (revision 37cf66c8)
1phosphor_logging_dep = dependency(
2  'phosphor-logging',
3  fallback: ['phosphor-logging', 'phosphor_logging_dep'])
4
5src_includes = include_directories('.')
6
7executable(
8  'ncsi-netlink',
9  'argument.cpp',
10  'ncsi_netlink_main.cpp',
11  'ncsi_util.cpp',
12  implicit_include_directories: false,
13  include_directories: src_includes,
14  dependencies: [
15    dependency('libnl-3.0'),
16    dependency('libnl-genl-3.0'),
17    phosphor_dbus_interfaces_dep,
18    phosphor_logging_dep,
19  ],
20  install: true,
21  install_dir: get_option('bindir'))
22
23json_dep = declare_dependency()
24if get_option('sync-mac')
25  # nlohmann_json might not have a pkg-config. It is header only so just make
26  # sure we can access the needed symbols from the header.
27  has_json = meson.get_compiler('cpp').has_header_symbol(
28    'nlohmann/json.hpp',
29    'nlohmann::json::string_t',
30    required: false)
31  if not has_json
32    json_dep = dependency(
33      'nlohmann_json',
34      fallback: ['nlohmann_json', 'nlohmann_json_dep'],
35      required: true)
36  endif
37endif
38
39networkd_deps = [
40  json_dep,
41  phosphor_dbus_interfaces_dep,
42  phosphor_logging_dep,
43  networkd_dbus_dep,
44  sdbusplus_dep,
45  dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']),
46  dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
47]
48
49conf_header = configure_file(
50  output: 'config.h',
51  configuration: conf_data)
52
53networkd_lib = static_library(
54  'networkd',
55  conf_header,
56  'ethernet_interface.cpp',
57  'neighbor.cpp',
58  'ipaddress.cpp',
59  'netlink.cpp',
60  'network_config.cpp',
61  'network_manager.cpp',
62  'system_configuration.cpp',
63  'util.cpp',
64  'routing_table.cpp',
65  'config_parser.cpp',
66  'dhcp_configuration.cpp',
67  'vlan_interface.cpp',
68  'rtnetlink_server.cpp',
69  'dns_updater.cpp',
70  'watch.cpp',
71  implicit_include_directories: false,
72  include_directories: src_includes,
73  dependencies: networkd_deps)
74
75networkd_dep = declare_dependency(
76  sources: conf_header,
77  dependencies: networkd_deps,
78  include_directories: src_includes,
79  link_with: networkd_lib)
80
81executable(
82  'phosphor-network-manager',
83  'network_manager_main.cpp',
84  implicit_include_directories: false,
85  dependencies: networkd_dep,
86  install: true,
87  install_dir: get_option('bindir'))
88