From dfa562b5db95735edca8f7730d887f420e1cd585 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Mar 2015 11:01:53 +0100 Subject: [PATCH] build: make vdpau and dxva2 checks nicer Using check_statement() with an empty statement just to check for the header is quite a hack. Fix check_headers() (so it takes a "use" parameter), and use it for the checks instead. --- waftools/checks/generic.py | 4 ++-- wscript | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/waftools/checks/generic.py b/waftools/checks/generic.py index 831f7e2711..4b3a64f23b 100644 --- a/waftools/checks/generic.py +++ b/waftools/checks/generic.py @@ -109,7 +109,7 @@ def check_pkg_config(*args, **kw_ext): return result return fn -def check_headers(*headers): +def check_headers(*headers, **kw_ext): def undef_others(ctx, headers, found): not_found_hs = set(headers) - set([found]) for not_found_h in not_found_hs: @@ -119,7 +119,7 @@ def check_headers(*headers): def fn(ctx, dependency_identifier): for header in headers: defaults = {'header_name': header, 'features': 'c cprogram'} - options = __merge_options__(dependency_identifier, defaults) + options = __merge_options__(dependency_identifier, defaults, kw_ext) if ctx.check(**options): undef_others(ctx, headers, header) defkey = DependencyInflector(dependency_identifier).define_key() diff --git a/wscript b/wscript index fd37e4bbe7..7c1ef590ba 100644 --- a/wscript +++ b/wscript @@ -665,7 +665,7 @@ hwaccel_features = [ 'name': '--vaapi-hwaccel', 'desc': 'libavcodec VAAPI hwaccel', 'deps': [ 'vaapi' ], - 'func': check_statement('libavcodec/vaapi.h', '', use='libav'), + 'func': check_headers('libavcodec/vaapi.h', use='libav'), } , { 'name': '--vda-hwaccel', 'desc': 'libavcodec VDA hwaccel', @@ -691,7 +691,7 @@ hwaccel_features = [ 'name': '--dxva2-hwaccel', 'desc': 'libavcodec DXVA2 hwaccel', 'deps': [ 'gdi' ], - 'func': check_statement('libavcodec/dxva2.h', '', use='libav'), + 'func': check_headers('libavcodec/dxva2.h', use='libav'), } ]