Anton Kochkov <anton.koch...@proton.me> writes:

> Add crossplatform Meson file to build TCG plugins since
> the Makefile makes wrong assumptions about it being used only
> on Linux. Tested on Linux and macOS.

I think you should go the whole hog and remove the existing makefile
machinery. Otherwise it will be confusing to users who add new plugins
to the contrib directory.

Can the overall QEMU meson invoke this directly or will it get confused
by it being a separate project?

>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1710
> Signed-off-by: Anton Kochkov <anton.koch...@proton.me>
> ---
>  contrib/plugins/meson.build       | 31 +++++++++++++++++++++++++++++++
>  contrib/plugins/meson_options.txt |  1 +
>  2 files changed, 32 insertions(+)
>  create mode 100644 contrib/plugins/meson.build
>  create mode 100644 contrib/plugins/meson_options.txt
>
> diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build
> new file mode 100644
> index 0000000000..72c4167461
> --- /dev/null
> +++ b/contrib/plugins/meson.build
> @@ -0,0 +1,31 @@
> +project('qemu-plugins', 'c', meson_version: '>=0.50.0')
> +
> +qemu_src = get_option('qemu_path')
> +if qemu_src == ''
> +  qemu_src = '../..'
> +endif
> +
> +qemu_include = qemu_src + '/include/qemu'
> +incdir = include_directories(qemu_include)
> +
> +plugins = [
> +  'execlog',
> +  'hotblocks',
> +  'hotpages',
> +  'howvec',
> +  'lockstep',
> +  'hwprofile',
> +  'cache',
> +  'drcov',
> +]
> +
> +th = dependency('threads', required: true)
> +glib = dependency('glib-2.0', required: true)
> +
> +foreach p: plugins
> +  library(p, p + '.c',
> +    include_directories: incdir,
> +    dependencies: [th, glib],
> +    override_options: ['b_lundef=false']
> +  )
> +endforeach
> diff --git a/contrib/plugins/meson_options.txt 
> b/contrib/plugins/meson_options.txt
> new file mode 100644
> index 0000000000..2d76cda496
> --- /dev/null
> +++ b/contrib/plugins/meson_options.txt
> @@ -0,0 +1 @@
> +option('qemu_path', type : 'string', value : '', description : 'Full
> path to the QEMU sources to build plugins for')


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to