summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-06-07 20:45:33 -0700
committerGabe Black <gabeblack@google.com>2018-08-15 01:31:28 +0000
commit80bf4c8dbcaaa839754f006f8fc980b26222a70f (patch)
treee57bb756a608d72aef4de1a28804eff15166bd6a
parent411f9077dc914c76b37104acd209a7944cbf037a (diff)
downloadgem5-80bf4c8dbcaaa839754f006f8fc980b26222a70f.tar.xz
systemc, scons: Link systemc tests against the shared gem5 library.
Otherwise, having hundreds of statically linked gem5s takes up a huge amount of space, and all those repeated linkings brings the mightiest workstation to its knees with sufficient parallelism, or will take forever without it. Change-Id: I4c358b1a50c5e2b0027ac72423f887e24c786b19 Reviewed-on: https://gem5-review.googlesource.com/10959 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/tests/SConscript13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/systemc/tests/SConscript b/src/systemc/tests/SConscript
index cc7c476b3..81f122dab 100644
--- a/src/systemc/tests/SConscript
+++ b/src/systemc/tests/SConscript
@@ -62,10 +62,9 @@ if env['USE_SYSTEMC']:
}
ext_dir = Dir('..').Dir('ext')
- class SystemCTestBin(UnitTest):
+ class SystemCTestBin(Executable):
def __init__(self, test):
- super(SystemCTestBin, self).__init__(
- test.target, *test.sources, main=True)
+ super(SystemCTestBin, self).__init__(test.target, *test.sources)
@classmethod
def declare_all(cls, env):
@@ -80,6 +79,14 @@ if env['USE_SYSTEMC']:
super(SystemCTestBin, cls).declare_all(env)
+ def declare(self, env):
+ sources = list(self.sources)
+ for f in self.filters:
+ sources = Source.all.apply_filter(f)
+ objs = self.srcs_to_objs(env, sources)
+ objs = objs + env['SHARED_LIB'] + env['MAIN_OBJS']
+ return super(SystemCTestBin, self).declare(env, objs)
+
tests = []
def new_test(dirname, name):
test = SystemCTest(dirname, name)