Turn VALGRIND variable into a meson configuration switch

Configuration through environment variable is inconvenient with meson, because
they cannot be convieniently changed and/or are not preserved during
reconfiguration (https://github.com/mesonbuild/meson/issues/1503).
This adds -Dvalgrind=true/false, which has the advantage that it can be set
at any time with meson configure -Dvalgrind=... and ninja will rebuild targets
as necessary. Additional minor advantages are better consistency with the
options for hashmap debugging, and typo avoidance with '#if' instead of '#ifdef'.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-05-17 09:54:36 -07:00
committed by Lennart Poettering
parent 51b66c7a8a
commit d18cb3937b
8 changed files with 21 additions and 17 deletions
+1 -1
View File
@@ -281,7 +281,7 @@ static const struct hashmap_type_info hashmap_type_info[_HASHMAP_TYPE_MAX] = {
},
};
#ifdef VALGRIND
#if VALGRIND
__attribute__((destructor)) static void cleanup_pools(void) {
_cleanup_free_ char *t = NULL;
int r;