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