scons,python: Fix --without-python flag

Even with the `--without-python` flag, checks were still done to ensure
the correct version of Python was being used. This commit fixes this so
these checks are not performed when `--without-python` is enabled.

Change-Id: I2242f2971a49ef28cff229ad0337bce0a998413d
Issue-on: https://gem5.atlassian.net/browse/GEM5-880
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39715
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Lukas Steiner <lsteiner@rhrk.uni-kl.de>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2021-01-25 13:54:03 -08:00
parent a4345ff324
commit 758011f3c2
2 changed files with 32 additions and 25 deletions

View File

@@ -1208,11 +1208,6 @@ env.Command('sim/tags.cc', None,
Transform("VER TAGS")))
env.AlwaysBuild(tags)
# Build a small helper that marshals the Python code using the same
# version of Python as gem5. This is in an unorthodox location to
# avoid building it for every variant.
py_marshal = marshal_env.Program('marshal', 'python/marshal.cc')[0]
# Embed python files. All .py files that have been indicated by a
# PySource() call in a SConscript need to be embedded into the M5
# library. To do that, we compile the file to byte code, marshal the
@@ -1266,10 +1261,16 @@ EmbeddedPython embedded_${sym}(
''')
code.write(str(target[0]))
for source in PySource.all:
marshal_env.Command(source.cpp, [ py_marshal, source.tnode ],
if main['USE_PYTHON']:
# Build a small helper that marshals the Python code using the same
# version of Python as gem5. This is in an unorthodox location to
# avoid building it for every variant.
py_marshal = marshal_env.Program('marshal', 'python/marshal.cc')[0]
for source in PySource.all:
marshal_env.Command(source.cpp, [ py_marshal, source.tnode ],
MakeAction(embedPyFile, Transform("EMBED PY")))
Source(source.cpp, tags=source.tags, add_tags='python')
Source(source.cpp, tags=source.tags, add_tags='python')
########################################################################
#