diff options
author | kcgen <kcgen@users.noreply.github.com> | 2022-09-24 00:59:27 +0300 |
---|---|---|
committer | kcgen <kcgen@users.noreply.github.com> | 2022-09-24 00:59:27 +0300 |
commit | f4d34cbcd0e6b86d7e82074f5abf50c172b2250d (patch) | |
tree | f1e7acb9b01456250a0c73759703a9ea6c9f28ea | |
parent | ba9a9b9c5ac0de840a74308015bdd64928c5d63d (diff) |
Use SpeexDSP from the system if passes testskc/lib-deps-1
-rw-r--r-- | meson.build | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/meson.build b/meson.build index d9fcda913..e2aabcf88 100644 --- a/meson.build +++ b/meson.build @@ -369,31 +369,31 @@ zlib_dep = dependency( # SpeexDSP # ~~~~~~~~ -# If the user asked to use SpeexDSP from the system then -# we need to ensure its floating-point API is reliable -# -use_speexdsp_from_system = 'speexdsp' in system_libs_list -if use_speexdsp_from_system - check_cpp = files('contrib/check-speexdsp/test_speexdsp_float_api.cpp') - check_if_msg = 'SpeexDSP system library has reliable floating-point API' - check_result = cxx.run( - check_cpp, - dependencies: dependency('speexdsp'), - name: check_if_msg, +# Default to the system library +speexdsp_dep = dependency( + 'speexdsp', + allow_fallback: false, + static: ('speexdsp' in static_libs_list or prefers_static_libs), +) + +# The system has SpeexDSP, so test its floating-point handling +if speexdsp_dep.found() + system_speexdsp_test = cxx.run( + files('contrib/check-speexdsp/test_speexdsp_float_api.cpp'), + dependencies: speexdsp_dep, + name: 'SpeexDSP system library has reliable floating-point API', ) - use_speexdsp_from_system = ( - check_result.compiled() - and check_result.returncode() == 0 + is_system_speexdsp_reliable = ( + system_speexdsp_test.compiled() + and system_speexdsp_test.returncode() == 0 ) + if is_system_speexdsp_reliable + speexdsp_summary_msg = 'system library' + endif endif -if use_speexdsp_from_system - speexdsp_dep = dependency( - 'speexdsp', - allow_fallback: false, - static: ('speexdsp' in static_libs_list or prefers_static_libs), - ) - speexdsp_summary_msg = 'system library' -else + +# The system doesn't have SpeexDSP or it's unreiable, so use the wrap +if not speexdsp_dep.found() or not is_system_speexdsp_reliable speexdsp_dep = subproject( 'speexdsp', default_options: ['default_library=static', 'warning_level=0'], |