diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-07-27 18:59:23 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-07-27 19:04:38 +0530 |
commit | b55dfb5313f1df702a3637efbd372b90cd12a300 (patch) | |
tree | ae7f255314e783be74b9201cd6dfcd8ca9da18b5 /ext/hls | |
parent | 7ef303fa281b9226ebd0087fb377ca25887941e4 (diff) | |
download | gstreamer-plugins-bad-b55dfb5313f1df702a3637efbd372b90cd12a300.tar.gz |
Add feature options for almost all plugins
The only plugins remaining are those that haven't been ported to Meson
yet, and msdk. Also, the tests are still automagic.
https://bugzilla.gnome.org/show_bug.cgi?id=795107
Diffstat (limited to 'ext/hls')
-rw-r--r-- | ext/hls/meson.build | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/ext/hls/meson.build b/ext/hls/meson.build index e631958ab..1f5f58d42 100644 --- a/ext/hls/meson.build +++ b/ext/hls/meson.build @@ -10,23 +10,45 @@ hls_sources = [ hls_cargs = ['-DGST_USE_UNSTABLE_API'] -# FIXME: Add an option for selecting the library, and fail if it's not found -hls_crypto_dep = dependency('nettle', required : false) -if hls_crypto_dep.found() - hls_cargs += ['-DHAVE_NETTLE'] -else - hls_crypto_dep = cc.find_library('gcrypt', required : false) - if hls_crypto_dep.found() - hls_cargs += ['-DHAVE_LIBGCRYPT'] - else - hls_crypto_dep = openssl_dep +hls_crypto = get_option('hls-crypto') +hls_option = get_option('hls') + +have_hls_crypto = false +if not hls_option.disabled() + if ['auto', 'nettle'].contains(hls_crypto) + hls_crypto_dep = dependency('nettle', required : false) + if hls_crypto_dep.found() + have_hls_crypto = true + hls_cargs += ['-DHAVE_NETTLE'] + endif + endif + + if not hls_crypto_dep.found() and ['auto', 'libgcrypt'].contains(hls_crypto) + hls_crypto_dep = cc.find_library('gcrypt', required : false) + if hls_crypto_dep.found() + have_hls_crypto = true + hls_cargs += ['-DHAVE_LIBGCRYPT'] + endif + endif + + if not hls_crypto_dep.found() and ['auto', 'openssl'].contains(hls_crypto) + hls_crypto_dep = dependency('openssl', required : false) if hls_crypto_dep.found() + have_hls_crypto = true hls_cargs += ['-DHAVE_OPENSSL'] endif endif + + if not have_hls_crypto and hls_option.enabled() + if hls_crypto == 'auto' + error('HLS plugin enabled, but found none of nettle, libgcrypt, or openssl') + else + error('HLS plugin enabled, but crypto library "@0@" not found'.format(hls_crypto)) + endif + endif endif -if hls_crypto_dep.found() +if have_hls_crypto gsthls = library('gsthls', hls_sources, c_args : gst_plugins_bad_args + hls_cargs, |