From ddc25eb40444f4bbcfea276d22beee6494c3f18e Mon Sep 17 00:00:00 2001 From: Pierrick Bouvier Date: Wed, 21 May 2025 15:34:14 -0700 Subject: [PATCH] meson: merge hw_common_arch in target_common_system_arch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No need to keep two different libraries, as both are compiled with exact same flags. As well, rename target common libraries to common_{arch} and system_{arch}, to follow what exists for common and system libraries. Signed-off-by: Pierrick Bouvier Tested-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20250521223414.248276-8-pierrick.bouvier@linaro.org Signed-off-by: Paolo Bonzini --- meson.build | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index 1c9f1aa91e..f614d11219 100644 --- a/meson.build +++ b/meson.build @@ -4101,7 +4101,6 @@ common_all = static_library('common', dependencies: common_ss.all_dependencies()) # construct common libraries per base architecture -hw_common_arch_libs = {} target_common_arch_libs = {} target_common_system_arch_libs = {} foreach target_base_arch, config_base_arch : config_base_arch_mak @@ -4130,22 +4129,10 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak target_c_args = ['-DCPU_DEFS_H'] target_system_c_args = target_c_args + ['-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOFTMMU'] - if target_base_arch in hw_common_arch - src = hw_common_arch[target_base_arch] - lib = static_library( - 'hw_' + target_base_arch, - build_by_default: false, - sources: src.all_sources() + genh, - include_directories: inc, - c_args: target_system_c_args, - dependencies: src.all_dependencies() + common_deps + system_deps) - hw_common_arch_libs += {target_base_arch: lib} - endif - if target_base_arch in target_common_arch src = target_common_arch[target_base_arch] lib = static_library( - 'target_' + target_base_arch, + 'common_' + target_base_arch, build_by_default: false, sources: src.all_sources() + genh, include_directories: inc, @@ -4155,10 +4142,20 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak target_common_arch_libs += {target_base_arch: lib} endif + # merge hw_common_arch in target_common_system_arch + if target_base_arch in hw_common_arch + hw_src = hw_common_arch[target_base_arch] + if target_base_arch in target_common_system_arch + target_common_system_arch[target_base_arch].add_all(hw_src) + else + target_common_system_arch += {target_base_arch: hw_src} + endif + endif + if target_base_arch in target_common_system_arch src = target_common_system_arch[target_base_arch] lib = static_library( - 'target_system_' + target_base_arch, + 'system_' + target_base_arch, build_by_default: false, sources: src.all_sources() + genh, include_directories: inc, @@ -4351,12 +4348,6 @@ foreach target : target_dirs objects += libuser.extract_objects(src.sources()) arch_deps += src.dependencies() endif - if target_type == 'system' and target_base_arch in hw_common_arch_libs - src = hw_common_arch[target_base_arch].apply(config_target, strict: false) - lib = hw_common_arch_libs[target_base_arch] - objects += lib.extract_objects(src.sources()) - arch_deps += src.dependencies() - endif if target_type == 'system' and target_base_arch in target_common_system_arch_libs src = target_common_system_arch[target_base_arch].apply(config_target, strict: false) lib = target_common_system_arch_libs[target_base_arch] -- 2.39.5