| 1 | if not have_system |
| 2 | subdir_done() |
| 3 | else |
| 4 | message('Rust enabled but it is only used by system emulators.') |
| 5 | endif |
| 6 | |
| 7 | cargo_ws = import('rust').workspace() |
| 8 | |
| 9 | genrs = [] |
| 10 | |
| 11 | subdir('qemu-macros') |
| 12 | |
| 13 | subdir('common') |
| 14 | subdir('bindings') |
| 15 | subdir('bits') |
| 16 | |
| 17 | subdir('util') |
| 18 | subdir('bql') |
| 19 | subdir('migration') |
| 20 | subdir('qom') |
| 21 | subdir('chardev') |
| 22 | subdir('hw/core') |
| 23 | subdir('system') |
| 24 | subdir('tests') |
| 25 | subdir('trace') |
| 26 | subdir('hw') |
| 27 | |
| 28 | cargo = find_program('cargo', required: false) |
| 29 | |
| 30 | if cargo.found() |
| 31 | run_target('rustfmt', |
| 32 | command: [config_host['MESON'], 'devenv', |
| 33 | '--workdir', '@CURRENT_SOURCE_DIR@', |
| 34 | cargo, 'fmt'], |
| 35 | depends: genrs) |
| 36 | endif |