mirror of https://github.com/mpv-player/mpv
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.
(cherry picked from commit dfa562b5db
)
This commit is contained in:
parent
c77f076ae4
commit
cac071dc23
|
@ -109,7 +109,7 @@ def check_pkg_config(*args, **kw_ext):
|
||||||
return result
|
return result
|
||||||
return fn
|
return fn
|
||||||
|
|
||||||
def check_headers(*headers):
|
def check_headers(*headers, **kw_ext):
|
||||||
def undef_others(ctx, headers, found):
|
def undef_others(ctx, headers, found):
|
||||||
not_found_hs = set(headers) - set([found])
|
not_found_hs = set(headers) - set([found])
|
||||||
for not_found_h in not_found_hs:
|
for not_found_h in not_found_hs:
|
||||||
|
@ -119,7 +119,7 @@ def check_headers(*headers):
|
||||||
def fn(ctx, dependency_identifier):
|
def fn(ctx, dependency_identifier):
|
||||||
for header in headers:
|
for header in headers:
|
||||||
defaults = {'header_name': header, 'features': 'c cprogram'}
|
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):
|
if ctx.check(**options):
|
||||||
undef_others(ctx, headers, header)
|
undef_others(ctx, headers, header)
|
||||||
defkey = DependencyInflector(dependency_identifier).define_key()
|
defkey = DependencyInflector(dependency_identifier).define_key()
|
||||||
|
|
4
wscript
4
wscript
|
@ -691,7 +691,7 @@ hwaccel_features = [
|
||||||
'name': '--vaapi-hwaccel',
|
'name': '--vaapi-hwaccel',
|
||||||
'desc': 'libavcodec VAAPI hwaccel',
|
'desc': 'libavcodec VAAPI hwaccel',
|
||||||
'deps': [ 'vaapi' ],
|
'deps': [ 'vaapi' ],
|
||||||
'func': check_statement('libavcodec/vaapi.h', '', use='libav'),
|
'func': check_headers('libavcodec/vaapi.h', use='libav'),
|
||||||
} , {
|
} , {
|
||||||
'name': '--vda-hwaccel',
|
'name': '--vda-hwaccel',
|
||||||
'desc': 'libavcodec VDA hwaccel',
|
'desc': 'libavcodec VDA hwaccel',
|
||||||
|
@ -717,7 +717,7 @@ hwaccel_features = [
|
||||||
'name': '--dxva2-hwaccel',
|
'name': '--dxva2-hwaccel',
|
||||||
'desc': 'libavcodec DXVA2 hwaccel',
|
'desc': 'libavcodec DXVA2 hwaccel',
|
||||||
'deps': [ 'gdi' ],
|
'deps': [ 'gdi' ],
|
||||||
'func': check_statement('libavcodec/dxva2.h', '', use='libav'),
|
'func': check_headers('libavcodec/dxva2.h', use='libav'),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue