blob: b8a138a5955b8b2368c10cce8a4cdeb43a898dea [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
43systemd_system_unit_dir = dependency('systemd').get_pkgconfig_variable(
44 'systemdsystemunitdir',
45 define_variable: ['prefix', get_option('prefix')])
46udev_dir = dependency('udev').get_pkgconfig_variable(
47 'udev_dir',
48 define_variable: ['prefix', get_option('prefix')])
49
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)