Skip to content

Commit

Permalink
tasks: Properly convert sanitizers to meson
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Oct 15, 2024
1 parent 76f2179 commit 2fc3876
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,22 @@ def ci_docs_add_ssh(c, ssh_key, host_key):
def get_sanitizers(meson=False):
sanitizers = os.getenv('SANITIZERS', '')
if meson:
return f'-D b_sanitize={sanitizers}' if sanitizers != '' else ''
subst = {
'tsan': 'thread',
'asan': 'address',
'ubsan': 'undefined'
}
meson_sanitizers = ''
sanitizers = sanitizers.split('+')
for sanitizer in sanitizers:
if sanitizer in subst:
if meson_sanitizers != '':
meson_sanitizers = meson_sanitizers + ','
meson_sanitizers = meson_sanitizers + subst[sanitizer]
else:
meson_sanitizers = meson_sanitizers + sanitizer

return f'-D b_sanitize={meson_sanitizers}' if meson_sanitizers != '' else ''
if sanitizers != '':
sanitizers = sanitizers.split('+')
sanitizers = ['--enable-' + sanitizer for sanitizer in sanitizers]
Expand Down

0 comments on commit 2fc3876

Please sign in to comment.