[PATCH 16/22] plugins: allow plugins to be enabled on windows

Alex Bennée posted 22 patches 1 year ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>
[PATCH 16/22] plugins: allow plugins to be enabled on windows
Posted by Alex Bennée 1 year ago
From: Greg Manning <gmanning@rapitasystems.com>

allow plugins to be enabled in the configure script on windows. Also,
add the qemu_plugin_api.lib to the installer.

Signed-off-by: Greg Manning <gmanning@rapitasystems.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231102172053.17692-5-gmanning@rapitasystems.com>
[AJB: add check for dlltool to configure]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231103195956.1998255-30-alex.bennee@linaro.org>
---
 configure   | 4 ++--
 meson.build | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index e50ec99fe2..abcb199aa8 100755
--- a/configure
+++ b/configure
@@ -1011,9 +1011,9 @@ if test "$targetos" = "bogus"; then
 fi
 
 # test for any invalid configuration combinations
-if test "$targetos" = "windows"; then
+if test "$targetos" = "windows" && ! has "$dlltool"; then
   if test "$plugins" = "yes"; then
-    error_exit "TCG plugins not currently supported on Windows platforms"
+    error_exit "TCG plugins requires dlltool to build on Windows platforms"
   fi
   plugins="no"
 fi
diff --git a/meson.build b/meson.build
index dcef8b1e79..b855224acc 100644
--- a/meson.build
+++ b/meson.build
@@ -3904,6 +3904,11 @@ endforeach
 
 if get_option('plugins')
   install_headers('include/qemu/qemu-plugin.h')
+  if targetos == 'windows'
+    # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
+    # so that plugin authors can compile against it.
+    install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
+  endif
 endif
 
 subdir('qga')
-- 
2.39.2


Re: [PATCH 16/22] plugins: allow plugins to be enabled on windows
Posted by Philippe Mathieu-Daudé 1 year ago
On 6/11/23 19:51, Alex Bennée wrote:
> From: Greg Manning <gmanning@rapitasystems.com>
> 
> allow plugins to be enabled in the configure script on windows. Also,
> add the qemu_plugin_api.lib to the installer.
> 
> Signed-off-by: Greg Manning <gmanning@rapitasystems.com>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20231102172053.17692-5-gmanning@rapitasystems.com>
> [AJB: add check for dlltool to configure]
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20231103195956.1998255-30-alex.bennee@linaro.org>
> ---
>   configure   | 4 ++--
>   meson.build | 5 +++++
>   2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index e50ec99fe2..abcb199aa8 100755
> --- a/configure
> +++ b/configure
> @@ -1011,9 +1011,9 @@ if test "$targetos" = "bogus"; then
>   fi
>   
>   # test for any invalid configuration combinations
> -if test "$targetos" = "windows"; then
> +if test "$targetos" = "windows" && ! has "$dlltool"; then
>     if test "$plugins" = "yes"; then
> -    error_exit "TCG plugins not currently supported on Windows platforms"
> +    error_exit "TCG plugins requires dlltool to build on Windows platforms"
>     fi
>     plugins="no"
>   fi
> diff --git a/meson.build b/meson.build
> index dcef8b1e79..b855224acc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3904,6 +3904,11 @@ endforeach
>   
>   if get_option('plugins')
>     install_headers('include/qemu/qemu-plugin.h')
> +  if targetos == 'windows'
> +    # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer,
> +    # so that plugin authors can compile against it.
> +    install_data(win32_qemu_plugin_api_lib, install_dir: 'lib')
> +  endif
>   endif
>   
>   subdir('qga')

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>