From 69ed25971d7e8cd27ccefdc8ed7613e8a47336b1 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 8 Feb 2021 01:03:13 -0800 Subject: [PATCH] scons: Eliminate CXX_V and main_dict_keys in SConstruct. CXX_V isn't used by anything, and main_dict_keys is unnecessary because using "in" with the whole main environment (which acts like a dict) checks against the keys without needing a temporary variable. Change-Id: Iab07246c00b1969858659043cead1dd657b1707b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40963 Tested-by: kokoro Maintainer: Gabe Black Reviewed-by: Andreas Sandberg --- SConstruct | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 915c1123f8..b63e2cc519 100755 --- a/SConstruct +++ b/SConstruct @@ -141,10 +141,8 @@ main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main)) from gem5_scons.util import get_termcap termcap = get_termcap() -main_dict_keys = main.Dictionary().keys() - # Check that we have a C/C++ compiler -if not ('CC' in main_dict_keys and 'CXX' in main_dict_keys): +if not ('CC' in main and 'CXX' in main): error("No C++ compiler installed (package g++ on Ubuntu and RedHat)") ################################################### @@ -302,8 +300,7 @@ main['TCMALLOC_CCFLAGS'] = [] # builds under a given build root run on the same host platform. conf = gem5_scons.Configure(main) -CXX_version = readCommand([main['CXX'],'--version'], exception=False) -CXX_V = readCommand([main['CXX'],'-V'], exception=False) +CXX_version = readCommand([main['CXX'], '--version'], exception=False) main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0