scons: Enable explicitly building something with no variant.
authorGabe Black <gabeblack@google.com>
Fri, 19 May 2017 23:30:45 +0000 (16:30 -0700)
committerGabe Black <gabeblack@google.com>
Mon, 22 May 2017 17:07:22 +0000 (17:07 +0000)
The SConstruct currently expects all explicit targets to be under a
variant directory like ARM or X86 which tells it what settings to use,
etc. There are things which scons knows how to build however, which do not
live under a variant directory, specifically everything under ext.

This change makes scons not look for a variant directory when it
encounters a target which is built by something in ext. This enables
things like explicitly building the systemc libraries, for example.

Change-Id: I8982a96fe49e3cb970ec78e11cea08703990c686
Reviewed-on: https://gem5-review.googlesource.com/3460
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Christian Menard <christian.menard@tu-dresden.de>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

SConstruct

index 30f99c7b21703f148e6912d2d39fdd9641cb007a..65179f10a051f1cd6e8da5c4f8ea8e7b9a4b08f1 100755 (executable)
@@ -1314,9 +1314,11 @@ main.Append(BUILDERS = { 'PartialShared' : partial_shared_builder,
 
 # builds in ext are shared across all configs in the build root.
 ext_dir = abspath(joinpath(str(main.root), 'ext'))
+ext_build_dirs = []
 for root, dirs, files in os.walk(ext_dir):
     if 'SConscript' in files:
         build_dir = os.path.relpath(root, ext_dir)
+        ext_build_dirs.append(build_dir)
         main.SConscript(joinpath(root, 'SConscript'),
                         variant_dir=joinpath(build_root, build_dir))
 
@@ -1412,6 +1414,9 @@ for variant_path in variant_paths:
         sticky_vars.files.append(current_vars_file)
         if not GetOption('silent'):
             print "Using saved variables file %s" % current_vars_file
+    elif variant_dir in ext_build_dirs:
+        # Things in ext are built without a variant directory.
+        continue
     else:
         # Build dir-specific variables file doesn't exist.