scons: Update enum output when not using python

This changeset brings the enum_cc.py file in line with how the
sim_object_param_struct_cc.py file works and updates the SConscript to
correctly tag the created source files.

Change-Id: I4635a4f46de7d62a6c38e71ace121c06e139d486
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/59609
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Jason Lowe-Power
2022-05-11 13:53:58 -07:00
committed by Jason Lowe-Power
parent e8e0a2ed06
commit 8e8c1ded15
2 changed files with 38 additions and 30 deletions

View File

@@ -186,7 +186,8 @@ class SimObject(PySource):
SIMOBJ=simobj,
PARAMS_CC=cc_file,
USE_PYTHON=env['USE_PYTHON'])
Source(cc_file, tags=self.tags, add_tags='python')
Source(cc_file, tags=self.tags,
add_tags=('python' if env['USE_PYTHON'] else None))
# CXX config header.
gem5py_env.Command([ "${CXXCONFIG_HH}" ], srcs,
@@ -230,8 +231,9 @@ class SimObject(PySource):
ENUM=enum,
ENUM_CC=cc_file,
ENUMCC_PY=build_tools.File('enum_cc.py'),
USE_PYTHON='--use-python' if env['USE_PYTHON'] else '')
Source(cc_file, tags=self.tags, add_tags='python')
USE_PYTHON=env['USE_PYTHON'])
Source(cc_file, tags=self.tags,
add_tags=('python' if env['USE_PYTHON'] else None))
# This regular expression is simplistic and assumes that the import takes up
# the entire line, doesn't have the keyword "public", uses double quotes, has