qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/7] vhost-user-scsi: convert to Meson


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 6/7] vhost-user-scsi: convert to Meson
Date: Thu, 27 Jun 2019 14:31:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 27/06/19 13:23, Markus Armbruster wrote:
> Note that there's also glib dependency, which works the same (see
> previous patch).  With Make, we add GLib flags to QEMU_CFLAGS and LIBS,
> so they get used for everything unless overridden.

Having to add glib everywhere is mildly annoying.  We can avoid that
once we convert libqemuutil.a to meson, via

libqemuutil = static_library('qemuutil', ...)
libqemuutil = declare_dependency(link_with: libqemuutil,
                                 dependencies: glib)

>> +libiscsi = declare_dependency(compile_args: 
>> config_host['LIBISCSI_CFLAGS'].split(),
>> +                          link_args: config_host['LIBISCSI_LIBS'].split())
> ... we define here.  Less magical.

A couple notes here.  First, later on this declare_dependency() will be
replaced by dependency(), so that meson itself will run pkg-config
rather than our configure script.

Second, some magic will reappear once we start using sourcesets[1],
which allow dependencies will be attached to sources rather than
executables.  However, there will still be no need to track cflags and
ldflags separately.  It will look like this:

# in block/meson.build
block.add(when: libiscsi, if_true: files('iscsi.c'))

# in toplevel meson.build
block_obj = block.apply(config_host)
executable('qemu-img',
           sources: ['qemu-img.c', block_obj.sources()],
           dependencies: [libqemutil, block_obj.dependencies()])

Paolo

[1] https://mesonbuild.com/SourceSet-module.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]