scons: Use sets instead of lists to track needed target environments.

This simple change intrinsically collapses away duplicates.

Change-Id: I697c21897a81c47cbf540caa49806413dce80dba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48129
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-07-10 00:47:29 -07:00
parent 9278d7eda4
commit 6811158b28

View File

@@ -1407,7 +1407,7 @@ else:
# need. We try to identify the needed environment for each target; if
# we can't, we fall back on instantiating all the environments just to
# be safe.
target_types = ['debug', 'opt', 'fast', 'prof', 'perf']
target_types = {'debug', 'opt', 'fast', 'prof', 'perf'}
obj2target = {'do': 'debug', 'o': 'opt', 'fo': 'fast', 'po': 'prof',
'gpo' : 'perf'}
@@ -1419,9 +1419,9 @@ def identifyTarget(t):
return obj2target[ext]
return 'all'
needed_envs = [identifyTarget(target) for target in BUILD_TARGETS]
needed_envs = {identifyTarget(target) for target in BUILD_TARGETS}
if 'all' in needed_envs:
needed_envs += target_types
needed_envs = target_types
# Debug binary
if 'debug' in needed_envs: