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 6 qga_vss = shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'], 7 name_prefix: '', 8 cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'], 9 link_args: link_args, 10 vs_module_defs: 'qga-vss.def', 11 dependencies: [glib_static, socket, 12 cc.find_library('ole32'), 13 cc.find_library('oleaut32'), 14 cc.find_library('shlwapi'), 15 cc.find_library('uuid'), 16 cc.find_library('intl')]) 17endif 18 19# rules to build qga-vss.tlb 20# Currently, only native build is supported because building .tlb 21# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++). 22midl = find_program('midl', required: false) 23if midl.found() 24 gen_tlb = custom_target('gen-tlb', 25 input: 'qga-vss.idl', 26 output: 'qga-vss.tlb', 27 command: [midl, '-tlb', '-I' + config_host['WIN_SDK'], 28 '@INPUT@', '@OUTPUT@']) 29else 30 gen_tlb = custom_target('gen-tlb', 31 input: 'qga-vss.tlb', 32 output: 'qga-vss.tlb', 33 command: ['cp', '@INPUT@', '@OUTPUT@']) 34endif 35