William A. Kennington III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 1 | phosphor_logging_dep = dependency( |
| 2 | 'phosphor-logging', |
| 3 | fallback: ['phosphor-logging', 'phosphor_logging_dep']) |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 4 | |
| 5 | src_includes = include_directories('.') |
| 6 | |
| 7 | executable( |
| 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 James | fa1f5c0 | 2020-09-17 15:12:46 -0500 | [diff] [blame] | 15 | dependency('fmt'), |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 16 | 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 | |
| 24 | json_dep = declare_dependency() |
| 25 | if 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 |
| 38 | endif |
| 39 | |
| 40 | networkd_deps = [ |
| 41 | json_dep, |
| 42 | phosphor_dbus_interfaces_dep, |
| 43 | phosphor_logging_dep, |
William A. Kennington III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 44 | networkd_dbus_dep, |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 45 | sdbusplus_dep, |
| 46 | dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']), |
| 47 | dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']), |
| 48 | ] |
| 49 | |
| 50 | conf_header = configure_file( |
| 51 | output: 'config.h', |
| 52 | configuration: conf_data) |
| 53 | |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 54 | networkd_lib = static_library( |
| 55 | 'networkd', |
William A. Kennington III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 56 | conf_header, |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 57 | '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 III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 73 | include_directories: src_includes, |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 74 | dependencies: networkd_deps) |
| 75 | |
| 76 | networkd_dep = declare_dependency( |
William A. Kennington III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 77 | sources: conf_header, |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 78 | dependencies: networkd_deps, |
William A. Kennington III | 37cf66c | 2021-05-17 14:56:54 -0700 | [diff] [blame] | 79 | include_directories: src_includes, |
William A. Kennington III | 1bbe3d1 | 2021-05-13 23:45:09 -0700 | [diff] [blame] | 80 | link_with: networkd_lib) |
| 81 | |
| 82 | executable( |
| 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')) |