src/modules/meson: ensure Opus libs were actually found, too

The old way fails, if a distro has the header but not the library,
which can happen on at least Gentoo with multilib deployments,
where the shared header is present but non-native libraries might not.

This could still fail, if a distro had some but not all libraries for
some architectures but hopefully no one did that. In that case, a compile
test would likely be required via cc.check_header() instead but let's try
the faster fix first.

Reported-by: Sam James <sam@gentoo.org>
Thanks-to: Barnabás Pőcze <pobrn@protonmail.com>
Thanks-to: Xavier Claessens <xavier.claessens@collabora.com>
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
This commit is contained in:
Niklāvs Koļesņikovs 2023-06-26 16:35:01 +03:00 committed by Wim Taymans
parent 15ddbfd037
commit e4cc63a6dc

View file

@ -203,7 +203,8 @@ endif
summary({'ffado-driver': build_module_ffado_driver}, bool_yn: true, section: 'Optional Modules')
opus_custom_h = cc.has_header('opus/opus_custom.h', dependencies: opus_dep)
if opus_custom_h
# One would imagine that opus_dep is a requirement but for some reason it's not, so we need to manually check that
if opus_dep.found() and opus_custom_h
opus_custom_dep = declare_dependency(compile_args: ['-DHAVE_OPUS_CUSTOM'], dependencies: opus_dep)
else
opus_custom_dep = dependency('', required: false)