From 5a2da7d7f5aaf65216137dbce998e29ad1eb637e Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez <ryan.gonzalez@collabora.com> Date: Fri, 21 Feb 2025 16:59:23 -0600 Subject: [PATCH] build: Refactor sanitizer detection Splitting the list first instead of matching on strings is a bit easier to understand but also makes it easier to add other related tests later on. steamrt/tasks#677 Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com> --- meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 16debfcc..7660073c 100644 --- a/meson.build +++ b/meson.build @@ -201,11 +201,20 @@ silence_wflinfo_warnings = c_compiler.get_supported_arguments([ '-Wno-switch-default', ]) +enabled_sanitizers = get_option('b_sanitize').split(',') + # wflinfo with libwaffle 1.8.0 appears to have a leak from # wegl_display_init(), which we don't particularly care about for a # short-lived process -if ['undefined', 'address,undefined'].contains(get_option('b_sanitize')) - no_leak_sanitizer = ['b_sanitize=undefined'] +no_leak_sanitizer = [] +foreach sanitizer : enabled_sanitizers + if sanitizer != 'address' + no_leak_sanitizer += [sanitizer] + endif +endforeach + +if no_leak_sanitizer.length() > 0 + no_leak_sanitizer = ['b_sanitize=' + ','.join(no_leak_sanitizer)] else no_leak_sanitizer = ['b_sanitize=none'] endif -- GitLab