meson: Add support orc fallback

Allow fallback to orc subproject if any.
Additionally 'dependencies' keyword is removed from find_library,
because it's invalid keyword for find_library.
This commit is contained in:
Seungha Yang 2019-01-30 19:44:01 +09:00
parent 869e45d19c
commit fe7885b13e
2 changed files with 9 additions and 3 deletions

View file

@ -322,7 +322,8 @@ libsinc = include_directories('gst-libs')
have_orcc = false
orcc_args = []
# Used by various libraries/elements that use Orc code
orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'))
orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'),
fallback : ['orc', 'orc_dep'])
orcc = find_program('orcc', required : get_option('orc'))
if orc_dep.found() and orcc.found()
have_orcc = true

View file

@ -207,13 +207,18 @@ orc_tests = [
['orc_videobox', files('../../gst/videobox/gstvideoboxorc.orc')],
]
orc_test_dep = dependency('', required : false)
if have_orcc
# FIXME: there should really just be a separate orc-test-0.4.pc file for this
if orc_dep.type_name() == 'pkgconfig'
orc_test_dep = cc.find_library('orc-test-0.4', dependencies: orc_dep)
else
orc_test_dep = cc.find_library('orc-test-0.4', required : false)
endif
if not orc_test_dep.found()
orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'])
endif
endif
if have_orcc and orc_test_dep.found()
foreach t : orc_tests
tname = t[0]
torcfile = t[1]