blob: bb1dc60be3a53fe0528acaa457b3c7859611f37e [file] [log] [blame]
George Liucc742332021-10-20 16:25:55 +08001if cpp.has_header('CLI/CLI.hpp')
2 CLI11_dep = declare_dependency()
3else
4 CLI11_dep = dependency(
5 'CLI11',
6 fallback: [ 'CLI11', 'CLI11_dep' ],
7 )
8endif
9
10source = [
11 'usb_manager_main.cpp',
George Liu073a6532021-10-25 14:40:03 +080012 'usb_manager.cpp',
George Liufc025e12021-11-09 19:29:12 +080013 '../utils.cpp',
George Liucc742332021-10-20 16:25:55 +080014 ]
15
George Liu5107c452021-11-09 20:06:31 +080016sdeventplus_dep = dependency(
17 'sdeventplus',
18 fallback: [
19 'sdeventplus',
20 'sdeventplus_dep'
21 ],
22)
23
George Liu073a6532021-10-25 14:40:03 +080024phosphor_logging_dep = dependency(
25 'phosphor-logging',
26 fallback: ['phosphor-logging', 'phosphor_logging_dep'],
27)
28
George Liucc742332021-10-20 16:25:55 +080029executable(
30 'phosphor-usb-code-update',
31 source,
George Liu073a6532021-10-25 14:40:03 +080032 include_directories: ['..'],
George Liucc742332021-10-20 16:25:55 +080033 dependencies: [
34 CLI11_dep,
George Liu073a6532021-10-25 14:40:03 +080035 phosphor_logging_dep,
George Liufc025e12021-11-09 19:29:12 +080036 sdbusplus_dep,
George Liu5107c452021-11-09 20:06:31 +080037 sdeventplus_dep,
George Liucc742332021-10-20 16:25:55 +080038 ],
39 install: true,
40 install_dir: get_option('bindir')
41)
George Liu6d775e62021-10-26 10:44:30 +080042
Lei YU3d8ab812021-12-24 10:35:47 +080043systemd_system_unit_dir = dependency('systemd').get_variable(
44 pkgconfig: 'systemdsystemunitdir',
45 pkgconfig_define: ['prefix', get_option('prefix')])
46udev_dir = dependency('udev').get_variable(
47 pkgconfig: 'udev_dir',
48 pkgconfig_define: ['prefix', get_option('prefix')])
George Liu6d775e62021-10-26 10:44:30 +080049
50install_data(
51 'services/usb-code-update@.service',
52 install_dir: systemd_system_unit_dir
53)
54
55install_data(
56 '70-bmc-usb.rules',
57 install_dir: udev_dir / 'rules.d'
58)