mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
plugins: factorize plugin dependencies and library details
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260124182921.531562-3-pierrick.bouvier@linaro.org Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
This commit is contained in:
@@ -9,17 +9,8 @@ endif
|
||||
t = []
|
||||
if get_option('plugins')
|
||||
foreach i : contrib_plugins
|
||||
if host_os == 'windows'
|
||||
t += shared_module(i, files(i + '.c') + '../../plugins/win32_linker.c',
|
||||
include_directories: '../../include/qemu',
|
||||
link_depends: [win32_qemu_plugin_api_lib],
|
||||
link_args: win32_qemu_plugin_api_link_flags,
|
||||
dependencies: glib)
|
||||
else
|
||||
t += shared_module(i, files(i + '.c'),
|
||||
include_directories: '../../include/qemu',
|
||||
dependencies: glib)
|
||||
endif
|
||||
t += shared_module(i, files(i + '.c'),
|
||||
dependencies: plugins_deps)
|
||||
endforeach
|
||||
endif
|
||||
if t.length() > 0
|
||||
|
||||
@@ -4450,7 +4450,7 @@ if get_option('plugins')
|
||||
if host_os == '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')
|
||||
install_data(win32_qemu_plugin_api, install_dir: 'lib')
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -51,11 +51,24 @@ if host_os == 'windows'
|
||||
dlltool_cmd = [dlltool, '--input-def', '@INPUT@',
|
||||
'--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe']
|
||||
endif
|
||||
win32_qemu_plugin_api_lib = configure_file(
|
||||
win32_qemu_plugin_api = configure_file(
|
||||
input: win32_plugin_def,
|
||||
output: 'libqemu_plugin_api.a',
|
||||
command: dlltool_cmd
|
||||
)
|
||||
win32_qemu_plugin_api_lib = static_library('win32_qemu_plugin_api',
|
||||
link_depends: win32_qemu_plugin_api)
|
||||
endif
|
||||
|
||||
if host_os == 'windows'
|
||||
plugins_deps = declare_dependency(sources: [files('win32_linker.c')],
|
||||
include_directories: '../include/qemu',
|
||||
link_with: win32_qemu_plugin_api_lib,
|
||||
link_args: win32_qemu_plugin_api_link_flags,
|
||||
dependencies: glib)
|
||||
else
|
||||
plugins_deps = declare_dependency(include_directories: '../include/qemu',
|
||||
dependencies: glib)
|
||||
endif
|
||||
|
||||
user_ss.add(files('user.c', 'api-user.c'))
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
t = []
|
||||
if get_option('plugins')
|
||||
foreach i : ['bb', 'discons', 'empty', 'inline', 'insn', 'mem', 'reset', 'syscall', 'patch']
|
||||
if host_os == 'windows'
|
||||
t += shared_module(i, files(i + '.c') + '../../../plugins/win32_linker.c',
|
||||
include_directories: '../../../include/qemu',
|
||||
link_depends: [win32_qemu_plugin_api_lib],
|
||||
link_args: win32_qemu_plugin_api_link_flags,
|
||||
dependencies: glib)
|
||||
else
|
||||
t += shared_module(i, files(i + '.c'),
|
||||
include_directories: '../../../include/qemu',
|
||||
dependencies: glib)
|
||||
endif
|
||||
t += shared_module(i, files(i + '.c'),
|
||||
dependencies: plugins_deps)
|
||||
endforeach
|
||||
endif
|
||||
if t.length() > 0
|
||||
|
||||
Reference in New Issue
Block a user