From 611207eff058c3499dc34b020d02243ae78ef833 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 20 Jul 2021 23:26:53 -0700 Subject: [PATCH] scons: Clean up the definition of m5.defines a little bit. Use the new helper functions to go to/from a Value(), and tidy things up slightly. Change-Id: I9a31004b5a610bb8e94848d1fb88606dda6fc3c2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48381 Maintainer: Bobby R. Bruce Tested-by: kokoro Reviewed-by: Hoa Nguyen --- src/SConscript | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/SConscript b/src/SConscript index c53567f26d..50633df5b9 100644 --- a/src/SConscript +++ b/src/SConscript @@ -690,15 +690,12 @@ depends.sort(key = lambda x: x.name) # Generate Python file containing a dict specifying the current # buildEnv flags. def makeDefinesPyFile(target, source, env): - build_env = source[0].get_contents().decode('utf-8') - code = code_formatter() - code("buildEnv = dict($build_env)") + code("buildEnv = $0", FromValue(source[0])) code.write(target[0].abspath) -defines_info = Value(build_env) # Generate a file with all of the compile options in it -env.Command('python/m5/defines.py', defines_info, +env.Command('python/m5/defines.py', ToValue(dict(build_env)), MakeAction(makeDefinesPyFile, Transform("DEFINES", 0))) PySource('m5', 'python/m5/defines.py')