On 8/5/24 09:51, Paolo Bonzini wrote:
Avoid having to list dependencies such as libfdt twice, both on common_ss
and specific_ss.  Instead, just take all the dependencies in common_ss
and allow the target-specific libqemu-*.fa library to use them.

Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
  meson.build              | 14 +++++++++++---
  hw/arm/meson.build       |  2 +-
  hw/loongarch/meson.build |  2 +-
  hw/mips/meson.build      |  2 +-
  hw/openrisc/meson.build  |  4 ++--
  hw/ppc/meson.build       |  4 +---
  hw/riscv/meson.build     |  2 +-
  7 files changed, 18 insertions(+), 12 deletions(-)


    target_common = common_ss.apply(config_target, strict: false)
    objects = common_all.extract_objects(target_common.sources())
-  deps = target_common.dependencies()
+  arch_deps += target_common.dependencies()
target_specific = specific_ss.apply(config_target, strict: false)
    arch_srcs += target_specific.sources()
    arch_deps += target_specific.dependencies()
+ # allow using headers from the dependencies but do not include the sources,
+  # because this emulator only needs those in "objects".  For external
+  # dependencies, the full dependency is included below in the executable.
+  lib_deps = []
+  foreach dep : arch_deps
+    lib_deps += dep.partial_dependency(compile_args: true, includes: true)

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>

+  endforeach
+
    lib = static_library('qemu-' + target,
                   sources: arch_srcs + genh,
-                 dependencies: arch_deps,
+                 dependencies: lib_deps,
                   objects: objects,
                   include_directories: target_inc,
                   c_args: c_args,
@@ -3924,7 +3932,7 @@ foreach target : target_dirs
      emulator = executable(exe_name, exe['sources'],
                 install: true,
                 c_args: c_args,
-               dependencies: arch_deps + deps + exe['dependencies'],
+               dependencies: arch_deps + exe['dependencies'],

Reply via email to