xref: /openbmc/qemu/rust/meson.build (revision 18c9f4a1729db1389218983379f6d62a9e550754)
1subproject('bilge-0.2-rs', required: true)
2subproject('bilge-impl-0.2-rs', required: true)
3subproject('libc-0.2-rs', required: true)
4
5bilge_rs = dependency('bilge-0.2-rs')
6bilge_impl_rs = dependency('bilge-impl-0.2-rs')
7libc_rs = dependency('libc-0.2-rs')
8
9subproject('proc-macro2-1-rs', required: true)
10subproject('quote-1-rs', required: true)
11subproject('syn-2-rs', required: true)
12
13quote_rs_native = dependency('quote-1-rs', native: true)
14syn_rs_native = dependency('syn-2-rs', native: true)
15proc_macro2_rs_native = dependency('proc-macro2-1-rs', native: true)
16
17qemuutil_rs = qemuutil.partial_dependency(link_args: true, links: true)
18
19subdir('qemu-api-macros')
20subdir('qemu-api')
21
22subdir('hw')
23
24cargo = find_program('cargo', required: false)
25
26if cargo.found()
27  run_target('clippy',
28    command: [config_host['MESON'], 'devenv',
29              '--workdir', '@CURRENT_SOURCE_DIR@',
30              cargo, 'clippy', '--tests'],
31    depends: bindings_rs)
32
33  run_target('rustfmt',
34    command: [config_host['MESON'], 'devenv',
35              '--workdir', '@CURRENT_SOURCE_DIR@',
36              cargo, 'fmt'],
37    depends: bindings_rs)
38
39  run_target('rustdoc',
40    command: [config_host['MESON'], 'devenv',
41              '--workdir', '@CURRENT_SOURCE_DIR@',
42              cargo, 'doc', '--no-deps', '--document-private-items'],
43    depends: bindings_rs)
44endif
45