blob: a2c37588a1f103a5bce5c546c6df6b315791ecb6 [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: [
Eddie Jamesfa1f5c02020-09-17 15:12:46 -050015 dependency('fmt'),
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070016 dependency('libnl-3.0'),
17 dependency('libnl-genl-3.0'),
18 phosphor_dbus_interfaces_dep,
19 phosphor_logging_dep,
20 ],
21 install: true,
22 install_dir: get_option('bindir'))
23
24json_dep = declare_dependency()
25if get_option('sync-mac')
26 # nlohmann_json might not have a pkg-config. It is header only so just make
27 # sure we can access the needed symbols from the header.
28 has_json = meson.get_compiler('cpp').has_header_symbol(
29 'nlohmann/json.hpp',
30 'nlohmann::json::string_t',
31 required: false)
32 if not has_json
33 json_dep = dependency(
34 'nlohmann_json',
35 fallback: ['nlohmann_json', 'nlohmann_json_dep'],
36 required: true)
37 endif
38endif
39
40networkd_deps = [
41 json_dep,
42 phosphor_dbus_interfaces_dep,
43 phosphor_logging_dep,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070044 networkd_dbus_dep,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070045 sdbusplus_dep,
46 dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']),
47 dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
48]
49
50conf_header = configure_file(
51 output: 'config.h',
52 configuration: conf_data)
53
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070054networkd_lib = static_library(
55 'networkd',
William A. Kennington III37cf66c2021-05-17 14:56:54 -070056 conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070057 'ethernet_interface.cpp',
58 'neighbor.cpp',
59 'ipaddress.cpp',
60 'netlink.cpp',
61 'network_config.cpp',
62 'network_manager.cpp',
63 'system_configuration.cpp',
64 'util.cpp',
65 'routing_table.cpp',
66 'config_parser.cpp',
67 'dhcp_configuration.cpp',
68 'vlan_interface.cpp',
69 'rtnetlink_server.cpp',
70 'dns_updater.cpp',
71 'watch.cpp',
72 implicit_include_directories: false,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070073 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070074 dependencies: networkd_deps)
75
76networkd_dep = declare_dependency(
William A. Kennington III37cf66c2021-05-17 14:56:54 -070077 sources: conf_header,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070078 dependencies: networkd_deps,
William A. Kennington III37cf66c2021-05-17 14:56:54 -070079 include_directories: src_includes,
William A. Kennington III1bbe3d12021-05-13 23:45:09 -070080 link_with: networkd_lib)
81
82executable(
83 'phosphor-network-manager',
84 'network_manager_main.cpp',
85 implicit_include_directories: false,
86 dependencies: networkd_dep,
87 install: true,
88 install_dir: get_option('bindir'))