Hi On Tue, Jul 12, 2022 at 6:58 PM Warner Losh <i...@bsdimp.com> wrote: > > > > On Tue, Jul 12, 2022 at 3:36 AM <marcandre.lur...@redhat.com> wrote: >> >> From: Marc-André Lureau <marcandre.lur...@redhat.com> >> >> Add a new meson subproject to provide common code and scripts for QEMU >> and tools. Initially, it will offer QAPI/QMP code generation and >> common utilities. >> >> libvhost-user & libvduse will make use of the subproject to avoid having >> include/ links to common headers. >> >> The other targeted user is qemu-ga, which will also be converted to a >> subproject (so it can be built, moved, released etc independent from QEMU). >> >> Other projects such as qemu-storage-daemon could be built standalone >> eventually in the future. >> >> Note that with meson subprojects are "global". Projects will share >> subprojects >> (https://mesonbuild.com/Subprojects.html#subprojects-depending-on-other-subprojects). >> We will add extra subprojects/ links to allow standalone subproject >> compilation though. >> >> This initial commit simply set the stage to build and link against it. >> >> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> >> --- >> meson.build | 9 ++++++++- >> .../qemu-common/include}/qemu/help-texts.h | 0 >> linux-user/meson.build | 4 ++-- >> subprojects/libvduse/meson.build | 2 ++ >> subprojects/libvduse/subprojects/qemu-common | 1 + >> subprojects/libvhost-user/meson.build | 2 ++ >> subprojects/libvhost-user/subprojects/qemu-common | 1 + >> subprojects/qemu-common/meson.build | 8 ++++++++ >> 8 files changed, 24 insertions(+), 3 deletions(-) >> rename {include => subprojects/qemu-common/include}/qemu/help-texts.h (100%) >> create mode 120000 subprojects/libvduse/subprojects/qemu-common >> create mode 120000 subprojects/libvhost-user/subprojects/qemu-common >> create mode 100644 subprojects/qemu-common/meson.build >> >> diff --git a/meson.build b/meson.build >> index bc5569ace159..254eb1263a66 100644 >> --- a/meson.build >> +++ b/meson.build >> @@ -167,6 +167,10 @@ if 'dtrace' in get_option('trace_backends') >> endif >> endif >> >> +add_project_arguments('-I' + meson.current_source_dir() / >> 'subprojects/qemu-common/include', >> + language: ['c', 'cpp', 'objc'], >> +) >> + >> if get_option('iasl') == '' >> iasl = find_program('iasl', required: false) >> else >> @@ -1577,6 +1581,9 @@ if libbpf.found() and not cc.links(''' >> endif >> endif >> >> +qemu_common = subproject('qemu-common') >> +qemu_common = qemu_common.get_variable('qemu_common_dep') >> + >> ################# >> # config-host.h # >> ################# >> @@ -3052,7 +3059,7 @@ util_ss.add_all(trace_ss) >> util_ss = util_ss.apply(config_all, strict: false) >> libqemuutil = static_library('qemuutil', >> sources: util_ss.sources() + stub_ss.sources() >> + genh, >> - dependencies: [util_ss.dependencies(), libm, >> threads, glib, socket, malloc, pixman]) >> + dependencies: [util_ss.dependencies(), libm, >> threads, glib, socket, malloc, pixman, qemu_common]) >> qemuutil = declare_dependency(link_with: libqemuutil, >> sources: genh + version_res, >> dependencies: [event_loop_base]) >> diff --git a/include/qemu/help-texts.h >> b/subprojects/qemu-common/include/qemu/help-texts.h >> similarity index 100% >> rename from include/qemu/help-texts.h >> rename to subprojects/qemu-common/include/qemu/help-texts.h >> diff --git a/linux-user/meson.build b/linux-user/meson.build >> index de4320af053c..fc6cdb55d657 100644 >> --- a/linux-user/meson.build >> +++ b/linux-user/meson.build >> @@ -7,7 +7,7 @@ linux_user_ss = ss.source_set() >> common_user_inc += include_directories('include/host/' / host_arch) >> common_user_inc += include_directories('include') >> >> -linux_user_ss.add(files( >> +linux_user_ss.add([files( >> 'elfload.c', >> 'exit.c', >> 'fd-trans.c', >> @@ -20,7 +20,7 @@ linux_user_ss.add(files( >> 'thunk.c', >> 'uaccess.c', >> 'uname.c', >> -)) >> +), qemu_common]) > > > Question: Why does linux-user need these, but bsd-user does not? >
Indeed, it's not needed anymore, thanks!