blob: d284a527fcaae5d200f80a8f8fb4e75de88d0435 [file] [log] [blame]
George Liucc742332021-10-20 16:25:55 +08001if cpp.has_header('CLI/CLI.hpp')
2 CLI11_dep = declare_dependency()
3else
Patrick Williamsc026f6c2022-03-21 09:37:14 -05004 CLI11_dep = dependency('CLI11')
George Liucc742332021-10-20 16:25:55 +08005endif
6
Patrick Williamsc026f6c2022-03-21 09:37:14 -05007sdeventplus_dep = dependency('sdeventplus')
8
Patrick Williamsec807fc2025-02-03 14:13:00 -05009source = ['usb_manager_main.cpp', 'usb_manager.cpp', '../utils.cpp']
George Liucc742332021-10-20 16:25:55 +080010
11executable(
12 'phosphor-usb-code-update',
13 source,
George Liu073a6532021-10-25 14:40:03 +080014 include_directories: ['..'],
George Liucc742332021-10-20 16:25:55 +080015 dependencies: [
16 CLI11_dep,
Jagpal Singh Gill2e506702024-08-03 16:35:15 -070017 pdi_dep,
George Liu073a6532021-10-25 14:40:03 +080018 phosphor_logging_dep,
George Liufc025e12021-11-09 19:29:12 +080019 sdbusplus_dep,
George Liu5107c452021-11-09 20:06:31 +080020 sdeventplus_dep,
George Liucc742332021-10-20 16:25:55 +080021 ],
22 install: true,
Patrick Williamscaa889e2025-04-19 12:39:38 -040023 install_dir: get_option('libexecdir') / 'phosphor-code-mgmt',
George Liucc742332021-10-20 16:25:55 +080024)
George Liu6d775e62021-10-26 10:44:30 +080025
Lei YU3d8ab812021-12-24 10:35:47 +080026udev_dir = dependency('udev').get_variable(
Patrick Williamse80b5bc2023-04-12 08:01:05 -050027 'udev_dir',
Patrick Williamsec807fc2025-02-03 14:13:00 -050028 pkgconfig_define: ['prefix', get_option('prefix')],
29)
George Liu6d775e62021-10-26 10:44:30 +080030
31install_data(
32 'services/usb-code-update@.service',
Patrick Williamsec807fc2025-02-03 14:13:00 -050033 install_dir: systemd_system_unit_dir,
George Liu6d775e62021-10-26 10:44:30 +080034)
35
Patrick Williamsec807fc2025-02-03 14:13:00 -050036install_data('70-bmc-usb.rules', install_dir: udev_dir / 'rules.d')