aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-05-18 12:07:22 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2023-05-26 12:34:18 +0200
commit58e48b2e721dcf70571d293e86c02eedbe3a0f39 (patch)
tree4776d45f4ff79cfee1545c5d9f527c0de2ab802d /meson.build
parent577bdbcf85d4c491da3271d99526b66c576d90e5 (diff)
meson: use subproject for internal libfdt
Recent dtc/libfdt can use either Make or meson as the build system. By using a subproject, our own meson.build can remove the hard coded list of source files. This is also the first step towards managing downloads with .wrap files instead of submodule. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build24
1 files changed, 4 insertions, 20 deletions
diff --git a/meson.build b/meson.build
index 218428841d..884b16c749 100644
--- a/meson.build
+++ b/meson.build
@@ -3088,26 +3088,10 @@ if fdt_required.length() > 0 or fdt_opt == 'enabled'
error('libfdt source not found - please pull git submodule')
endif
- fdt_files = files(
- 'dtc/libfdt/fdt.c',
- 'dtc/libfdt/fdt_ro.c',
- 'dtc/libfdt/fdt_wip.c',
- 'dtc/libfdt/fdt_sw.c',
- 'dtc/libfdt/fdt_rw.c',
- 'dtc/libfdt/fdt_strerror.c',
- 'dtc/libfdt/fdt_empty_tree.c',
- 'dtc/libfdt/fdt_addresses.c',
- 'dtc/libfdt/fdt_overlay.c',
- 'dtc/libfdt/fdt_check.c',
- )
-
- fdt_inc = include_directories('dtc/libfdt')
- libfdt = static_library('fdt',
- build_by_default: false,
- sources: fdt_files,
- include_directories: fdt_inc)
- fdt = declare_dependency(link_with: libfdt,
- include_directories: fdt_inc)
+ libfdt_proj = subproject('dtc', required: true,
+ default_options: ['tools=false', 'yaml=disabled',
+ 'python=disabled', 'default_library=static'])
+ fdt = libfdt_proj.get_variable('libfdt_dep')
endif
else
fdt_opt = 'disabled'