mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
meson: merge lib{system, user}_ss with {system, user}_ss
Now that target configuration can be applied to lib{system, user}_ss, there is no reason to keep that separate from the existing {system, user}_ss. The only difference is that we'll now compile those files with -DCOMPILING_SYSTEM_VS_USER, which removes poison for CONFIG_USER_ONLY and CONFIG_SOFTMMU, without any other side effect. We extract existing system/user code common common libraries to lib{system, user}. To not break existing meson files, we alias libsystem_ss to system_ss and libuser_ss to user_ss, so we can do the cleanup in next commit. Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/r/20250521223414.248276-6-pierrick.bouvier@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b17b51d325
commit
7ca433244c
1 changed files with 23 additions and 15 deletions
38
meson.build
38
meson.build
|
@ -3694,14 +3694,14 @@ io_ss = ss.source_set()
|
||||||
qmp_ss = ss.source_set()
|
qmp_ss = ss.source_set()
|
||||||
qom_ss = ss.source_set()
|
qom_ss = ss.source_set()
|
||||||
system_ss = ss.source_set()
|
system_ss = ss.source_set()
|
||||||
libsystem_ss = ss.source_set()
|
libsystem_ss = system_ss
|
||||||
specific_fuzz_ss = ss.source_set()
|
specific_fuzz_ss = ss.source_set()
|
||||||
specific_ss = ss.source_set()
|
specific_ss = ss.source_set()
|
||||||
rust_devices_ss = ss.source_set()
|
rust_devices_ss = ss.source_set()
|
||||||
stub_ss = ss.source_set()
|
stub_ss = ss.source_set()
|
||||||
trace_ss = ss.source_set()
|
trace_ss = ss.source_set()
|
||||||
user_ss = ss.source_set()
|
user_ss = ss.source_set()
|
||||||
libuser_ss = ss.source_set()
|
libuser_ss = user_ss
|
||||||
util_ss = ss.source_set()
|
util_ss = ss.source_set()
|
||||||
|
|
||||||
# accel modules
|
# accel modules
|
||||||
|
@ -4078,21 +4078,19 @@ common_ss.add(hwcore)
|
||||||
system_ss.add(authz, blockdev, chardev, crypto, io, qmp)
|
system_ss.add(authz, blockdev, chardev, crypto, io, qmp)
|
||||||
common_ss.add(qom, qemuutil)
|
common_ss.add(qom, qemuutil)
|
||||||
|
|
||||||
common_ss.add_all(when: 'CONFIG_SYSTEM_ONLY', if_true: [system_ss])
|
|
||||||
common_ss.add_all(when: 'CONFIG_USER_ONLY', if_true: user_ss)
|
|
||||||
|
|
||||||
libuser = static_library('user',
|
libuser = static_library('user',
|
||||||
libuser_ss.all_sources() + genh,
|
user_ss.all_sources() + genh,
|
||||||
c_args: ['-DCONFIG_USER_ONLY',
|
c_args: ['-DCONFIG_USER_ONLY',
|
||||||
'-DCOMPILING_SYSTEM_VS_USER'],
|
'-DCOMPILING_SYSTEM_VS_USER'],
|
||||||
dependencies: libuser_ss.all_dependencies(),
|
include_directories: common_user_inc,
|
||||||
|
dependencies: user_ss.all_dependencies(),
|
||||||
build_by_default: false)
|
build_by_default: false)
|
||||||
|
|
||||||
libsystem = static_library('system',
|
libsystem = static_library('system',
|
||||||
libsystem_ss.all_sources() + genh,
|
system_ss.all_sources() + genh,
|
||||||
c_args: ['-DCONFIG_SOFTMMU',
|
c_args: ['-DCONFIG_SOFTMMU',
|
||||||
'-DCOMPILING_SYSTEM_VS_USER'],
|
'-DCOMPILING_SYSTEM_VS_USER'],
|
||||||
dependencies: libsystem_ss.all_dependencies(),
|
dependencies: system_ss.all_dependencies(),
|
||||||
build_by_default: false)
|
build_by_default: false)
|
||||||
|
|
||||||
# Note that this library is never used directly (only through extract_objects)
|
# Note that this library is never used directly (only through extract_objects)
|
||||||
|
@ -4101,7 +4099,6 @@ libsystem = static_library('system',
|
||||||
common_all = static_library('common',
|
common_all = static_library('common',
|
||||||
build_by_default: false,
|
build_by_default: false,
|
||||||
sources: common_ss.all_sources() + genh,
|
sources: common_ss.all_sources() + genh,
|
||||||
include_directories: common_user_inc,
|
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
dependencies: common_ss.all_dependencies())
|
dependencies: common_ss.all_dependencies())
|
||||||
|
|
||||||
|
@ -4115,10 +4112,20 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak
|
||||||
inc = [common_user_inc + target_inc]
|
inc = [common_user_inc + target_inc]
|
||||||
|
|
||||||
target_common = common_ss.apply(config_target, strict: false)
|
target_common = common_ss.apply(config_target, strict: false)
|
||||||
|
target_system = system_ss.apply(config_target, strict: false)
|
||||||
|
target_user = user_ss.apply(config_target, strict: false)
|
||||||
common_deps = []
|
common_deps = []
|
||||||
|
system_deps = []
|
||||||
|
user_deps = []
|
||||||
foreach dep: target_common.dependencies()
|
foreach dep: target_common.dependencies()
|
||||||
common_deps += dep.partial_dependency(compile_args: true, includes: true)
|
common_deps += dep.partial_dependency(compile_args: true, includes: true)
|
||||||
endforeach
|
endforeach
|
||||||
|
foreach dep: target_system.dependencies()
|
||||||
|
system_deps += dep.partial_dependency(compile_args: true, includes: true)
|
||||||
|
endforeach
|
||||||
|
foreach dep: target_user.dependencies()
|
||||||
|
user_deps += dep.partial_dependency(compile_args: true, includes: true)
|
||||||
|
endforeach
|
||||||
|
|
||||||
# prevent common code to access cpu compile time definition,
|
# prevent common code to access cpu compile time definition,
|
||||||
# but still allow access to cpu.h
|
# but still allow access to cpu.h
|
||||||
|
@ -4133,7 +4140,7 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak
|
||||||
sources: src.all_sources() + genh,
|
sources: src.all_sources() + genh,
|
||||||
include_directories: inc,
|
include_directories: inc,
|
||||||
c_args: target_system_c_args,
|
c_args: target_system_c_args,
|
||||||
dependencies: src.all_dependencies() + common_deps)
|
dependencies: src.all_dependencies() + common_deps + system_deps)
|
||||||
hw_common_arch_libs += {target_base_arch: lib}
|
hw_common_arch_libs += {target_base_arch: lib}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -4145,7 +4152,8 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak
|
||||||
sources: src.all_sources() + genh,
|
sources: src.all_sources() + genh,
|
||||||
include_directories: inc,
|
include_directories: inc,
|
||||||
c_args: target_c_args,
|
c_args: target_c_args,
|
||||||
dependencies: src.all_dependencies() + common_deps)
|
dependencies: src.all_dependencies() + common_deps +
|
||||||
|
system_deps + user_deps)
|
||||||
target_common_arch_libs += {target_base_arch: lib}
|
target_common_arch_libs += {target_base_arch: lib}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -4157,7 +4165,7 @@ foreach target_base_arch, config_base_arch : config_base_arch_mak
|
||||||
sources: src.all_sources() + genh,
|
sources: src.all_sources() + genh,
|
||||||
include_directories: inc,
|
include_directories: inc,
|
||||||
c_args: target_system_c_args,
|
c_args: target_system_c_args,
|
||||||
dependencies: src.all_dependencies() + common_deps)
|
dependencies: src.all_dependencies() + common_deps + system_deps)
|
||||||
target_common_system_arch_libs += {target_base_arch: lib}
|
target_common_system_arch_libs += {target_base_arch: lib}
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
@ -4336,12 +4344,12 @@ foreach target : target_dirs
|
||||||
arch_deps += src.dependencies()
|
arch_deps += src.dependencies()
|
||||||
endif
|
endif
|
||||||
if target_type == 'system'
|
if target_type == 'system'
|
||||||
src = libsystem_ss.apply(config_target, strict: false)
|
src = system_ss.apply(config_target, strict: false)
|
||||||
objects += libsystem.extract_objects(src.sources())
|
objects += libsystem.extract_objects(src.sources())
|
||||||
arch_deps += src.dependencies()
|
arch_deps += src.dependencies()
|
||||||
endif
|
endif
|
||||||
if target_type == 'user'
|
if target_type == 'user'
|
||||||
src = libuser_ss.apply(config_target, strict: false)
|
src = user_ss.apply(config_target, strict: false)
|
||||||
objects += libuser.extract_objects(src.sources())
|
objects += libuser.extract_objects(src.sources())
|
||||||
arch_deps += src.dependencies()
|
arch_deps += src.dependencies()
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue