Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/3083

Change subject: scons: Make env['USE_PYTHON'] a source for createEnumStrings.
......................................................................

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
---
M src/SConscript
1 file changed, 4 insertions(+), 3 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index fd67533..c15da03 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -630,14 +630,15 @@
     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 @@
     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)

--
To view, visit https://gem5-review.googlesource.com/3083
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I803322ea1a178152da3d95dffffe20acd4271c88
Gerrit-Change-Number: 3083
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to