From f710b36ac4935bd6123df15a191c1fe089c4c233 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 19 Jan 2019 23:53:56 +0530 Subject: [PATCH] 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. --- sys/msdk/meson.build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/msdk/meson.build b/sys/msdk/meson.build index c94102d..e1ca582 100644 --- a/sys/msdk/meson.build +++ b/sys/msdk/meson.build @@ -70,14 +70,17 @@ if cxx.has_header('mfxvp9.h', args: '-I' + mfx_incdir) endif if host_machine.system() == 'windows' - legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: true) - d3d11_dep = cc.find_library('d3d11', required: true) + if cc.get_id() != 'msvc' and msdk_option.enabled() + 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_found = d3d11_dep.found() and legacy_stdio_dep.found() and cc.get_id() == 'msvc' else - libva_dep = dependency('libva-drm', required: true) - libdl_dep = cc.find_library('dl', required: true) - libgudev_dep = dependency('gudev-1.0', required: true) + libva_dep = dependency('libva-drm', required: get_option('msdk')) + libdl_dep = cc.find_library('dl', required: get_option('msdk')) + libgudev_dep = dependency('gudev-1.0', required: get_option('msdk')) 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() endif -- 2.7.4