diff --git a/SConstruct b/SConstruct index aad42de..1e0aaca 100644 --- a/SConstruct +++ b/SConstruct @@ -66,6 +66,13 @@ AddOption('--stack-protection', help = 'Build with stack protection support' ) +AddOption('--sanitizer', + dest = 'sanitizer', + action='store_true', + default=False, + help = 'Build with gcc sanitizer' +) + AddOption('--32', dest='force32bit', action='store_true', @@ -126,6 +133,10 @@ if GetOption('coverage'): env.Append(CFLAGS = ['--coverage']) env.Append(LINKFLAGS = ['--coverage']) +if GetOption('sanitizer'): + env.Append(CFLAGS = ['-fsanitize=undefined', '-fsanitize=address']) + env.Append(LINKFLAGS = ['-fsanitize=undefined', '-fsanitize=address']) + # Generate substitute dictionary subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info) subst_info['@prefix@'] = prefix