| 1 | # Generate bindgen arguments from Cargo.toml metadata |
| 2 | # Sort these in dependency order, same as the subdir() |
| 3 | # invocations below. |
| 4 | bindgen_dirs = [ |
| 5 | 'util-sys', |
| 6 | 'migration-sys', |
| 7 | 'qom-sys', |
| 8 | 'chardev-sys', |
| 9 | 'hwcore-sys', |
| 10 | 'system-sys', |
| 11 | ] |
| 12 | bindgen_args_file = configure_file( |
| 13 | command: [files('generate_bindgen_args.py'), |
| 14 | '-I', meson.project_source_root() / 'include', |
| 15 | '--source-dir', meson.current_source_dir(), |
| 16 | '-o', '@OUTPUT@', '--dep-file', '@DEPFILE@'] + bindgen_dirs, |
| 17 | output: 'bindgen_args.mak', |
| 18 | depfile: 'bindgen_args.d' |
| 19 | ) |
| 20 | |
| 21 | # now generate all bindgen files |
| 22 | bindgen_args_data = keyval.load(bindgen_args_file) |
| 23 | bindgen_kwargs = { |
| 24 | 'input': 'wrapper.h', |
| 25 | 'dependencies': common_ss.all_dependencies(), |
| 26 | 'output': 'bindings.inc.rs', |
| 27 | 'include_directories': bindings_incdir, |
| 28 | 'bindgen_version': ['>=0.60.0'], |
| 29 | 'c_args': bindgen_c_args, |
| 30 | } |
| 31 | |
| 32 | subdir('util-sys') |
| 33 | subdir('migration-sys') |
| 34 | subdir('qom-sys') |
| 35 | subdir('chardev-sys') |
| 36 | subdir('hwcore-sys') |
| 37 | subdir('system-sys') |