From: Philippe Mathieu-Daudé Date: Fri, 16 Jan 2026 07:45:55 +0000 (+0100) Subject: meson: Do not try to build module for empty per-target hw/ directory X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8efe5ff4a73b2af10aa80f82547d27ed6ff47dc;p=thirdparty%2Fqemu.git meson: Do not try to build module for empty per-target hw/ directory In commit 83d5db95d38 ("meson: Allow system binaries to not have target-specific units") we allowed targets with empty target_system_arch[] source set, but missed hw_arch[] could also be empty when building modules. Skip such case, otherwise due to commit a1ced487549 ("hw/microblaze: Build files once"), building with --enable-modules triggers: ../meson.build:4034:14: ERROR: Key microblaze is not in the dictionary. Fixes: a1ced487549 ("hw/microblaze: Build files once") Reported-by: Frederic Bezies Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3272 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Message-Id: <20260116131817.38009-1-philmd@linaro.org> --- diff --git a/meson.build b/meson.build index 3108f01e88..a84f14258b 100644 --- a/meson.build +++ b/meson.build @@ -3957,6 +3957,11 @@ if enable_modules foreach target : target_dirs if target.endswith('-softmmu') config_target = config_target_mak[target] + arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH'] + if not hw_arch.has_key(arch) + continue + endif + config_devices_mak = target + '-config-devices.mak' modinfo_src = custom_target('modinfo-' + target + '.c', output: 'modinfo-' + target + '.c', @@ -3966,8 +3971,6 @@ if enable_modules modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src) modinfo_dep = declare_dependency(link_with: modinfo_lib) - - arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH'] hw_arch[arch].add(modinfo_dep) endif endforeach