Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions site_scons/site_tools/compiler_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def _base_setup(env):

env.AppendIfSupported(CCFLAGS=DESIRED_FLAGS)

if 'SANITIZERS' in env and env['SANITIZERS'] != "":
if env.get('SANITIZERS'):

if "HEAP_PROFILER" in env and env['HEAP_PROFILER']:
if env.get('HEAP_PROFILER'):
print('Google Sanitizers and Gperftools.Heap.Profiler can not be mixed')
Exit(2)

Expand Down Expand Up @@ -92,7 +92,7 @@ def _base_setup(env):
env.AppendUnique(LINKFLAGS=flag)
print(f"Enabling {flag.split('=')[1]} sanitizer for C code")

if 'HEAP_PROFILER' in env and env['HEAP_PROFILER']:
if env.get('HEAP_PROFILER'):
env.AppendUnique(LINKFLAGS="-ltcmalloc")
print("Enabling Gperftools Heap Profiler")

Expand Down Expand Up @@ -223,7 +223,7 @@ def _check_func(env, func_name):
"""Check if a function is usable"""
denv = env.Clone()
# NOTE Remove sanitizers to not scramble the test output
if 'SANITIZERS' in denv and denv['SANITIZERS'] != "":
if denv.get('SANITIZERS'):
for sanitizer in denv['SANITIZERS'].split(','):
flag = f"-fsanitize={sanitizer}"
if flag not in denv["CCFLAGS"]:
Expand All @@ -232,7 +232,7 @@ def _check_func(env, func_name):
denv["LINKFLAGS"].remove(flag)

# NOTE Remove Heap Profiler to not scramble the test output
if 'HEAP_PROFILER' in denv and denv['HEAP_PROFILER']:
if denv.get('HEAP_PROFILER'):
denv["LINKFLAGS"].remove("-ltcmalloc")

config = Configure(denv)
Expand Down
Loading