]>
Commit | Line | Data |
---|---|---|
b906acac PB |
1 | plugin_ldflags = [] |
2 | # Modules need more symbols than just those in plugins/qemu-plugins.symbols | |
3 | if not enable_modules | |
d0cda6f4 | 4 | if host_os == 'darwin' |
e3af71e9 | 5 | configure_file( |
37650689 PB |
6 | input: files('qemu-plugins.symbols'), |
7 | output: 'qemu-plugins-ld64.symbols', | |
8 | capture: true, | |
9 | command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) | |
10 | plugin_ldflags = ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols'] | |
11 | else | |
12 | plugin_ldflags = ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')] | |
b906acac | 13 | endif |
64ed6f92 PB |
14 | endif |
15 | ||
2c13c574 | 16 | if get_option('plugins') |
d0cda6f4 | 17 | if host_os == 'windows' |
330fe3b0 GM |
18 | dlltool = find_program('dlltool', required: true) |
19 | ||
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 | |
22 | # available in qemu | |
23 | win32_plugin_def = configure_file( | |
24 | input: files('qemu-plugins.symbols'), | |
25 | output: 'qemu_plugin_api.def', | |
26 | capture: true, | |
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, | |
4789f9d3 | 31 | output: 'libqemu_plugin_api.a', |
330fe3b0 GM |
32 | command: [dlltool, '--input-def', '@INPUT@', |
33 | '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] | |
34 | ) | |
35 | endif | |
2c13c574 PB |
36 | specific_ss.add(files( |
37 | 'loader.c', | |
38 | 'core.c', | |
39 | 'api.c', | |
40 | ), declare_dependency(link_args: plugin_ldflags)) | |
41 | endif |