summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-05-05 18:01:33 -0700
committerGabe Black <gabeblack@google.com>2017-05-08 08:45:20 +0000
commitc40ebea9f4188f8c1ecd04d022b4e7ca60b1d185 (patch)
tree3f122903baabfe61f1429b21250a98081209fd96
parent306dea1eb84b9a2076adb626c269d796d0e4bc10 (diff)
downloadgem5-c40ebea9f4188f8c1ecd04d022b4e7ca60b1d185.tar.xz
scons: Make env['USE_PYTHON'] a source for createEnumStrings.
That clues scons in to the fact that the contents of the target of that function depends on the value of that construction variable. Change-Id: I803322ea1a178152da3d95dffffe20acd4271c88 Reviewed-on: https://gem5-review.googlesource.com/3083 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Paul Rosenfeld <prosenfeld@micron.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rwxr-xr-xsrc/SConscript7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/SConscript b/src/SConscript
index fd6753320..c15da03ac 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -630,14 +630,15 @@ def createSimObjectCxxConfig(is_header):
return body
def createEnumStrings(target, source, env):
- assert len(target) == 1 and len(source) == 1
+ assert len(target) == 1 and len(source) == 2
name = str(source[0].get_contents())
+ use_python = source[1].read()
obj = all_enums[name]
code = code_formatter()
obj.cxx_def(code)
- if env['USE_PYTHON']:
+ if use_python:
obj.pybind_def(code)
code.write(target[0].abspath)
@@ -732,7 +733,7 @@ for name,enum in sorted(all_enums.iteritems()):
extra_deps = [ py_source.tnode ]
cc_file = File('enums/%s.cc' % name)
- env.Command(cc_file, Value(name),
+ env.Command(cc_file, [Value(name), Value(env['USE_PYTHON'])],
MakeAction(createEnumStrings, Transform("ENUM STR")))
env.Depends(cc_file, depends + extra_deps)
Source(cc_file)