scons: Make all sticky variables automatically exported.

All sticky vars are exported, but not all exported vars are sticky. The
vars which are exported but not sticky are (at least in general) found
with Configure() style measurement.

Change-Id: Idebf17e44c2eeca745cdfdd9f42eddcfdb0cf9ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56891
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Gabe Black
2022-02-15 00:33:01 -08:00
parent 443067253c
commit 06117275fa
8 changed files with 8 additions and 19 deletions

View File

@@ -60,7 +60,11 @@ Import('*')
# Children need to see the environment
Export('env')
build_env = [(opt, env[opt]) for opt in export_vars]
all_export_vars = set()
all_export_vars.update(export_vars)
all_export_vars.update(sticky_vars.keys())
build_env = [(opt, env[opt]) for opt in all_export_vars]
from code_formatter import code_formatter
@@ -533,7 +537,7 @@ for extra_dir in extras_dir_list:
build_dir = os.path.join(env['BUILDDIR'], root[prefix_len:])
SConscript(os.path.join(root, 'SConscript'), variant_dir=build_dir)
for opt in export_vars:
for opt in all_export_vars:
env.ConfigFile(opt)
def makeTheISA(source, target, env):

View File

@@ -33,5 +33,3 @@ def add_isa_lists():
sorted(set(main.Split('${ALL_GPU_ISAS}')))),
)
AfterSConsopts(add_isa_lists)
export_vars.extend(['TARGET_ISA', 'TARGET_GPU_ISA'])

View File

@@ -45,9 +45,3 @@ sticky_vars.AddVariables(
'The maximum number of ARM licenses to use concurrently', 1),
('SIMGEN', 'simgen executable', os.environ.get('SIMGEN', default_simgen)),
)
export_vars.extend([
'ARMLMD_LICENSE_FILE',
'PVLIB_HOME',
'PVLIB_FLAVOR',
])

View File

@@ -80,5 +80,4 @@ sticky_vars.Add(BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks',
export_vars.extend([
'HAVE_FENV', 'HAVE_PNG', 'USE_POSIX_CLOCK', 'HAVE_VALGRIND',
'HAVE_DEPRECATED_NAMESPACE'])
'HAVE_FENV', 'HAVE_PNG', 'HAVE_VALGRIND', 'HAVE_DEPRECATED_NAMESPACE'])

View File

@@ -76,7 +76,7 @@ if main['KVM_ISA']:
'Enable hardware virtualized (KVM) CPU models', True))
else:
main['USE_KVM'] = False
export_vars.append('USE_KVM')
warning("Can not enable KVM, host seems to lack KVM support")
export_vars.append('USE_KVM')
export_vars.append('KVM_ISA')

View File

@@ -27,5 +27,3 @@ Import('*')
sticky_vars.Add(BoolVariable('BUILD_GPU', 'Build the compute-GPU model',
False))
export_vars.append('BUILD_GPU')

View File

@@ -34,5 +34,3 @@ AfterSConsopts(add_protocols_var)
sticky_vars.Add(('NUMBER_BITS_PER_SET', 'Max elements in set (default 64)',
64))
export_vars.extend(['PROTOCOL', 'NUMBER_BITS_PER_SET'])

View File

@@ -46,5 +46,3 @@ main.AddMethod(use_systemc_check, 'UseSystemcCheck')
sticky_vars.Add(BoolVariable('USE_SYSTEMC', 'Enable SystemC API support',
main.UseSystemcCheck()))
export_vars.append('USE_SYSTEMC')