scons: Declare PySource Source files in the PySource __init__.

There's no reason to wait until the end to loop over all PySource files
and declare their Source-s then.

Change-Id: I94de1b2123bb94324a647bbc005a923012080cab
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49386
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Gabe Black
2021-08-04 23:36:49 -07:00
parent 6a36839da5
commit ec931a6413

View File

@@ -175,6 +175,8 @@ class PySource(SourceFile):
marshal_env.Command(self.cpp, [ py_marshal, self.tnode ],
MakeAction(embedPyFile, Transform("EMBED PY")))
if main['USE_PYTHON']:
Source(self.cpp, tags=self.tags, add_tags='python')
class SimObject(PySource):
'''Add a SimObject python file as a python source object and add
@@ -957,10 +959,6 @@ env.Command('sim/tags.cc', None,
Transform("VER TAGS")))
env.AlwaysBuild(tags)
if main['USE_PYTHON']:
for source in PySource.all:
Source(source.cpp, tags=source.tags, add_tags='python')
########################################################################
#
# Define binaries. Each different build type (debug, opt, etc.) gets