mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
scripts: waifulib: add asan-only build type
This commit is contained in:
@@ -30,7 +30,7 @@ compiler_optimizations.CFLAGS['gottagofast'] = {
|
||||
}
|
||||
'''
|
||||
|
||||
VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'none']
|
||||
VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'asan', 'none']
|
||||
|
||||
LINKFLAGS = {
|
||||
'common': {
|
||||
@@ -42,6 +42,11 @@ LINKFLAGS = {
|
||||
'clang': ['-fsanitize=memory', '-pthread'],
|
||||
'default': ['NO_MSAN_HERE']
|
||||
},
|
||||
'asan': {
|
||||
'clang': ['-fsanitize=address', '-pthread'],
|
||||
'gcc': ['-fsanitize=address', '-pthread'],
|
||||
'msvc': ['/SAFESEH:NO']
|
||||
},
|
||||
'sanitize': {
|
||||
'clang': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||
'gcc': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||
@@ -95,6 +100,12 @@ CFLAGS = {
|
||||
'clang': ['-O2', '-g', '-fno-omit-frame-pointer', '-fsanitize=memory', '-pthread'],
|
||||
'default': ['NO_MSAN_HERE']
|
||||
},
|
||||
'asan': {
|
||||
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
|
||||
'gcc': ['-Og', '-fsanitize=address', '-pthread'],
|
||||
'clang': ['-Og', '-fsanitize=address', '-pthread'],
|
||||
'default': ['-O0']
|
||||
},
|
||||
'sanitize': {
|
||||
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
|
||||
'gcc': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||
|
||||
@@ -6,7 +6,7 @@ def options(opt):
|
||||
pass
|
||||
|
||||
def configure(conf):
|
||||
if conf.options.BUILD_TYPE != 'sanitize':
|
||||
if conf.options.BUILD_TYPE not in ['sanitize', 'asan']:
|
||||
conf.fatal('useless without -T sanitize')
|
||||
|
||||
if conf.env.COMPILER_CC != 'clang':
|
||||
|
||||
Reference in New Issue
Block a user