On 04/01/21 18:24, Roman Bolshakov wrote:
Hi Paolo,
I'm sorry I didn't reply earlier. As I showed in an example to Peter
(https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg00085.html):
https://github.com/mesonbuild/meson/commit/ff5dc65ef841857dd306694dff1fb1cd2bf801e4
The approach doesn't propogate dependencies of crypto beyond libcrypto.
i.e. if you specify crypto somewhere else as depedency, it won't pull
CFLAGS needed for gnutls.
Hi Roman,
After writing the meson patch in fact I noticed that get_dependencies()
is used only for linker flags. I got a very quick reply from the Meson
maintainer (https://github.com/mesonbuild/meson/pull/8151):
The fact that header flags are not passed transitively but libraries
are (in some cases) is intentional. Otherwise compiler flag counts
explode in deep hierarchies. Because of this include paths must be
exported manually, typically by adding the appropriate bits to a
declare_dependency.
Libs are a bit stupid, because you need to add direct dependencies
if, for example, you link to a static library.
Does it work if you do:
crypto_ss.add(authz, qom)
libcrypto = static_library('crypto', crypto_ss.sources() + genh,
dependencies: crypto_ss.dependencies(),
...)
crypto = declare_dependency(link_whole: libcrypto,
dependencies: crypto_ss.dependencies())
? If so, that is also a good option. If not, I will try to extend the
test case to pitch the Meson change.
Paolo