George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 1 | if cpp.has_header('CLI/CLI.hpp') |
| 2 | CLI11_dep = declare_dependency() |
| 3 | else |
Patrick Williams | c026f6c | 2022-03-21 09:37:14 -0500 | [diff] [blame] | 4 | CLI11_dep = dependency('CLI11') |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 5 | endif |
| 6 | |
Patrick Williams | c026f6c | 2022-03-21 09:37:14 -0500 | [diff] [blame] | 7 | sdeventplus_dep = dependency('sdeventplus') |
| 8 | |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 9 | source = [ |
| 10 | 'usb_manager_main.cpp', |
George Liu | 073a653 | 2021-10-25 14:40:03 +0800 | [diff] [blame] | 11 | 'usb_manager.cpp', |
George Liu | fc025e1 | 2021-11-09 19:29:12 +0800 | [diff] [blame] | 12 | '../utils.cpp', |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 13 | ] |
| 14 | |
| 15 | executable( |
| 16 | 'phosphor-usb-code-update', |
| 17 | source, |
George Liu | 073a653 | 2021-10-25 14:40:03 +0800 | [diff] [blame] | 18 | include_directories: ['..'], |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 19 | dependencies: [ |
| 20 | CLI11_dep, |
George Liu | 073a653 | 2021-10-25 14:40:03 +0800 | [diff] [blame] | 21 | phosphor_logging_dep, |
George Liu | fc025e1 | 2021-11-09 19:29:12 +0800 | [diff] [blame] | 22 | sdbusplus_dep, |
George Liu | 5107c45 | 2021-11-09 20:06:31 +0800 | [diff] [blame] | 23 | sdeventplus_dep, |
George Liu | cc74233 | 2021-10-20 16:25:55 +0800 | [diff] [blame] | 24 | ], |
| 25 | install: true, |
| 26 | install_dir: get_option('bindir') |
| 27 | ) |
George Liu | 6d775e6 | 2021-10-26 10:44:30 +0800 | [diff] [blame] | 28 | |
Lei YU | 3d8ab81 | 2021-12-24 10:35:47 +0800 | [diff] [blame] | 29 | systemd_system_unit_dir = dependency('systemd').get_variable( |
| 30 | pkgconfig: 'systemdsystemunitdir', |
| 31 | pkgconfig_define: ['prefix', get_option('prefix')]) |
| 32 | udev_dir = dependency('udev').get_variable( |
| 33 | pkgconfig: 'udev_dir', |
| 34 | pkgconfig_define: ['prefix', get_option('prefix')]) |
George Liu | 6d775e6 | 2021-10-26 10:44:30 +0800 | [diff] [blame] | 35 | |
| 36 | install_data( |
| 37 | 'services/usb-code-update@.service', |
| 38 | install_dir: systemd_system_unit_dir |
| 39 | ) |
| 40 | |
| 41 | install_data( |
| 42 | '70-bmc-usb.rules', |
| 43 | install_dir: udev_dir / 'rules.d' |
| 44 | ) |