Don't force sanitizers in debug builds

This commit is contained in:
Přemysl Eric Janouch 2022-01-07 08:37:00 +01:00
parent 59af3b7e7b
commit feda4fd70f
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -7,12 +7,15 @@ add_project_arguments(
language : 'c',
)
if get_option('buildtype').startswith('debug')
flags = meson.get_compiler('c').get_supported_arguments(
'-fsanitize=address,undefined')
add_project_arguments(flags, language : ['c'])
add_project_link_arguments(flags, language : ['c'])
endif
# This, annoyingly, enables the leak sanitizer by default,
# which requires some tuning to not stand in the way.
# Use -Db_sanitize=address,undefined and adjust LSAN_OPTIONS yourself.
#if get_option('buildtype').startswith('debug')
# flags = meson.get_compiler('c').get_supported_arguments(
# '-fsanitize=address,undefined')
# add_project_arguments(flags, language : ['c'])
# add_project_link_arguments(flags, language : ['c'])
#endif
lcms2 = dependency('lcms2', required : get_option('lcms2'))
# Note that only libraw_r is thread-safe, but we'll just run it out-of process.