xref: /openbmc/qemu/qga/vss-win32/meson.build (revision 7272fc72682c2573c67136e2c175d33d00d8905b)
1if add_languages('cpp', required: false)
2  glib_static = dependency('glib-2.0', static: true)
3  link_args = cc.get_supported_link_arguments(['-fstack-protector-all', '-fstack-protector-strong',
4                                               '-Wl,--add-stdcall-alias', '-Wl,--enable-stdcall-fixup'])
5  shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'],
6                name_prefix: '',
7                cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
8                link_args: link_args,
9                vs_module_defs: 'qga-vss.def',
10                dependencies: [glib_static, socket,
11                               cc.find_library('ole32'),
12                               cc.find_library('oleaut32'),
13                               cc.find_library('shlwapi'),
14                               cc.find_library('uuid'),
15                               cc.find_library('intl')])
16endif
17
18# rules to build qga-vss.tlb
19# Currently, only native build is supported because building .tlb
20# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
21midl = find_program('midl', required: false)
22if midl.found()
23  gen_tlb = custom_target('gen-tlb',
24                          input: 'qga-vss.idl',
25                          output: 'qga-vss.tlb',
26                          command: [midl, '-tlb', '-I' + config_host['WIN_SDK'],
27                                     '@INPUT@', '@OUTPUT@'])
28else
29  gen_tlb = custom_target('gen-tlb',
30                          input: 'qga-vss.tlb',
31                          output: 'qga-vss.tlb',
32                          command: ['cp', '@INPUT@', '@OUTPUT@'])
33endif
34