blob: 283995a0de242be2e43719ba463f83ef529b1e5f [file] [log] [blame]
William A. Kennington III37cf66c2021-05-17 14:56:54 -07001phosphor_logging_dep = dependency(
2 'phosphor-logging',
3 fallback: ['phosphor-logging', 'phosphor_logging_dep'])
William A. Kennington III1bbe3d12021-05-13 23:45:09 -07004
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,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070043 networkd_dbus_dep,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070044 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
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070053networkd_lib = static_library(
54 'networkd',
William A. Kennington III37cf66c2021-05-17 14:56:54 -070055 conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070056 '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,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070072 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070073 dependencies: networkd_deps)
74
75networkd_dep = declare_dependency(
William A. Kennington III37cf66c2021-05-17 14:56:54 -070076 sources: conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070077 dependencies: networkd_deps,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070078 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070079 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'))