Merge tag 'pull-loongarch-20240912' of https://gitlab.com/gaosong/qemu into staging
[qemu/kevin.git] / plugins / meson.build
blob1cc039d29b2e9530b0d0ca69e8a27d37e6554ea0
1 if not get_option('plugins')
2   subdir_done()
3 endif
5 # Modules need more symbols than just those in plugins/qemu-plugins.symbols
6 if not enable_modules
7   if host_os == 'darwin'
8     configure_file(
9       input: files('qemu-plugins.symbols'),
10       output: 'qemu-plugins-ld64.symbols',
11       capture: true,
12       command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@'])
13     emulator_link_args += ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols']
14   else
15     emulator_link_args += ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')]
16   endif
17 endif
19 if host_os == 'windows'
20   dlltool = find_program('dlltool', required: true)
22   # Generate a .lib file for plugins to link against.
23   # First, create a .def file listing all the symbols a plugin should expect to have
24   # available in qemu
25   win32_plugin_def = configure_file(
26     input: files('qemu-plugins.symbols'),
27     output: 'qemu_plugin_api.def',
28     capture: true,
29     command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@'])
30   # then use dlltool to assemble a delaylib.
31   win32_qemu_plugin_api_lib = configure_file(
32     input: win32_plugin_def,
33     output: 'libqemu_plugin_api.a',
34     command: [dlltool, '--input-def', '@INPUT@',
35               '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe']
36   )
37 endif
38 specific_ss.add(files(
39   'loader.c',
40   'core.c',
41   'api.c',