Added support for a local copy of dependencies, when the system version is not compatible or available

Change-Id: Ibd5c74bff376df49631710e72136416197251d62
This commit is contained in:
Thulinma 2022-12-28 13:19:56 +01:00
parent 529adbfaf6
commit 00833223e1
9 changed files with 273 additions and 10 deletions

View file

@ -92,26 +92,49 @@ message('Building release @0@ for version @1@ @ debug level @2@'.format(release,
ssl_deps = []
if usessl
ccpp = meson.get_compiler('cpp')
mbedtls = ccpp.find_library('mbedtls', required: false)
mbedx509 = ccpp.find_library('mbedx509', required: false)
mbedcrypto = ccpp.find_library('mbedcrypto', required: false)
# Test if we can compile the way we expect
code_ddvtech = '''
#include <mbedtls/ssl.h>
mbedtls_ssl_srtp_profile srtp_profiles[] ={MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80,
MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_32};
static int test()
{
mbedtls_ssl_config ssl_conf;
mbedtls_ssl_conf_dtls_srtp_protection_profiles(&ssl_conf, srtp_profiles,
sizeof(srtp_profiles) / sizeof(srtp_profiles[0]));
return 0;
}
'''
ddvtech_mbedtls = ccpp.compiles(code_ddvtech, dependencies: [mbedtls, mbedx509, mbedcrypto], name: 'MbedTLS is DDVTech fork')
if not mbedtls.found() or not ddvtech_mbedtls
mbedtls_proj = subproject('mbedtls')
mbedtls = mbedtls_proj.get_variable('mbedtls_dep')
mbedx509 = mbedtls_proj.get_variable('mbedx509_dep')
mbedcrypto = mbedtls_proj.get_variable('mbedcrypto_dep')
endif
srtp2 = dependency('libsrtp2', fallback : ['libsrtp2', 'libsrtp2_dep'])
ssl_deps = [mbedtls, mbedx509, mbedcrypto, srtp2]
endif
libsrt = false
if not get_option('NOSRT')
libsrt = dependency('srt', required: false)
libsrt = dependency('srt', fallback: ['libsrt', 'srt_dep'])
endif
have_srt = not get_option('NOSRT') and libsrt.found()
librist = false
if not get_option('NORIST')
librist = dependency('librist', required: false)
librist = dependency('librist', fallback: ['librist', 'librist_dep'], default_options:['test=false', 'built_tools=false'])
endif
have_librist = not get_option('NORIST') and librist.found()
if usessl
ccpp = meson.get_compiler('cpp')
mbedtls = ccpp.find_library('mbedtls')
mbedx509 = ccpp.find_library('mbedx509')
mbedcrypto = ccpp.find_library('mbedcrypto')
srtp2 = dependency('libsrtp2')
ssl_deps = [mbedtls, mbedx509, mbedcrypto, srtp2]
endif
# Set build targets