Valgrind is a bit of a strange beast, in general use one isn't supposed to link against valgrinds libs, they're non-PIC static libs, instead, including the headers does magic to make valgrind work. This patch implements a simple ValgrindDependency class subclassed from PkgConfigDependency, that overwrites (effectively) only the get_link_args method to always return an empty list. This solution may seem strange, but I think that it follows the principle of least surprise, and simplifies the most common use case for valgrind. Essentially without this every valgrind consumer would be forced to implement the following code to have a usable valgrind dependency object: _dep = dependency('valgrind', required : false) if _dep.found() valgrind_dep = declare_dependency( compile_args : _dep.get_pkgconfig_variable('Cflags') ) else valgrind_dep = [] endif While the above is workable, it's surprising behavior and the above code snippet becomes boilerplate that everyone needs to copy into their meson files. Fixes #826pull/1541/head
parent
fa10703124
commit
7aa28456df
2 changed files with 10 additions and 0 deletions
Loading…
Reference in new issue