2 # Modules need more symbols than just those in plugins/qemu-plugins.symbols
6 input: files('qemu-plugins.symbols'),
7 output: 'qemu-plugins-ld64.symbols',
9 command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@'])
10 plugin_ldflags = ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols']
12 plugin_ldflags = ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')]
16 if get_option('plugins')
17 if host_os == 'windows'
18 dlltool = find_program('dlltool', required: true)
20 # Generate a .lib file for plugins to link against.
21 # First, create a .def file listing all the symbols a plugin should expect to have
23 win32_plugin_def = configure_file(
24 input: files('qemu-plugins.symbols'),
25 output: 'qemu_plugin_api.def',
27 command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@'])
28 # then use dlltool to assemble a delaylib.
29 win32_qemu_plugin_api_lib = configure_file(
30 input: win32_plugin_def,
31 output: 'libqemu_plugin_api.a',
32 command: [dlltool, '--input-def', '@INPUT@',
33 '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe']
36 specific_ss.add(files(
40 ), declare_dependency(link_args: plugin_ldflags))