blob: da7fc92e85431bb4fd5e98a53d85f1c4a536dfcb [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
George Liucc742332021-10-20 16:25:55 +08009source = [
10 'usb_manager_main.cpp',
George Liu073a6532021-10-25 14:40:03 +080011 'usb_manager.cpp',
George Liufc025e12021-11-09 19:29:12 +080012 '../utils.cpp',
George Liucc742332021-10-20 16:25:55 +080013 ]
14
15executable(
16 'phosphor-usb-code-update',
17 source,
George Liu073a6532021-10-25 14:40:03 +080018 include_directories: ['..'],
George Liucc742332021-10-20 16:25:55 +080019 dependencies: [
20 CLI11_dep,
George Liu073a6532021-10-25 14:40:03 +080021 phosphor_logging_dep,
George Liufc025e12021-11-09 19:29:12 +080022 sdbusplus_dep,
George Liu5107c452021-11-09 20:06:31 +080023 sdeventplus_dep,
George Liucc742332021-10-20 16:25:55 +080024 ],
25 install: true,
26 install_dir: get_option('bindir')
27)
George Liu6d775e62021-10-26 10:44:30 +080028
Lei YU3d8ab812021-12-24 10:35:47 +080029systemd_system_unit_dir = dependency('systemd').get_variable(
30 pkgconfig: 'systemdsystemunitdir',
31 pkgconfig_define: ['prefix', get_option('prefix')])
32udev_dir = dependency('udev').get_variable(
33 pkgconfig: 'udev_dir',
34 pkgconfig_define: ['prefix', get_option('prefix')])
George Liu6d775e62021-10-26 10:44:30 +080035
36install_data(
37 'services/usb-code-update@.service',
38 install_dir: systemd_system_unit_dir
39)
40
41install_data(
42 '70-bmc-usb.rules',
43 install_dir: udev_dir / 'rules.d'
44)