meson: Fix automagic build of msdk plugin

When building the msdk plugin even if libmfx is found, unless the
plugin is explicitly enabled we should not error out if msdk
dependencies are not found.

Also give an error message when we don't build the plugin on Windows
because we're not building with MSVC.
This commit is contained in:
Nirbheek Chauhan 2019-01-19 23:53:56 +05:30 committed by Nirbheek Chauhan
parent 7ffcab3478
commit f710b36ac4

View file

@ -70,14 +70,17 @@ if cxx.has_header('mfxvp9.h', args: '-I' + mfx_incdir)
endif endif
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: true) if cc.get_id() != 'msvc' and msdk_option.enabled()
d3d11_dep = cc.find_library('d3d11', required: true) error('msdk plugin can only be built with MSVC')
endif
legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: get_option('msdk'))
d3d11_dep = cc.find_library('d3d11', required: get_option('msdk'))
msdk_deps = declare_dependency(dependencies: [d3d11_dep, legacy_stdio_dep]) msdk_deps = declare_dependency(dependencies: [d3d11_dep, legacy_stdio_dep])
msdk_deps_found = d3d11_dep.found() and legacy_stdio_dep.found() and cc.get_id() == 'msvc' msdk_deps_found = d3d11_dep.found() and legacy_stdio_dep.found() and cc.get_id() == 'msvc'
else else
libva_dep = dependency('libva-drm', required: true) libva_dep = dependency('libva-drm', required: get_option('msdk'))
libdl_dep = cc.find_library('dl', required: true) libdl_dep = cc.find_library('dl', required: get_option('msdk'))
libgudev_dep = dependency('gudev-1.0', required: true) libgudev_dep = dependency('gudev-1.0', required: get_option('msdk'))
msdk_deps = declare_dependency(dependencies: [libva_dep, libdl_dep, libgudev_dep]) msdk_deps = declare_dependency(dependencies: [libva_dep, libdl_dep, libgudev_dep])
msdk_deps_found = libva_dep.found() and libdl_dep.found() and libgudev_dep.found() msdk_deps_found = libva_dep.found() and libdl_dep.found() and libgudev_dep.found()
endif endif