Build and use a static library for repl & tests
This commit is contained in:
11
SConstruct
11
SConstruct
@@ -57,14 +57,17 @@ class BuildVariant:
|
|||||||
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
||||||
for p in LIB_SRCS
|
for p in LIB_SRCS
|
||||||
]
|
]
|
||||||
|
self.static_lib = self.env.StaticLibrary(self.built("uclisp"), self.lib_objs)
|
||||||
|
|
||||||
def configure_repl(self):
|
def configure_repl(self):
|
||||||
pgm_objs = [
|
pgm_objs = [
|
||||||
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
||||||
for p in PROGRAM_SOURCES
|
for p in PROGRAM_SOURCES
|
||||||
]
|
]
|
||||||
self.repl_program = self.env.Program(
|
repl_env = self.env.Clone()
|
||||||
self.built("uclisp"), self.lib_objs + pgm_objs
|
repl_env.Append(LIBS=[self.static_lib])
|
||||||
|
self.repl_program = repl_env.Program(
|
||||||
|
self.built("uclisp"), pgm_objs,
|
||||||
)
|
)
|
||||||
|
|
||||||
def configure_tests(self):
|
def configure_tests(self):
|
||||||
@@ -73,7 +76,9 @@ class BuildVariant:
|
|||||||
for p in TEST_LIB_SRCS
|
for p in TEST_LIB_SRCS
|
||||||
]
|
]
|
||||||
|
|
||||||
test_deps = test_lib_objs + self.lib_objs
|
self.test_env.Append(LIBS=[self.static_lib])
|
||||||
|
|
||||||
|
test_deps = test_lib_objs
|
||||||
test_objs = [
|
test_objs = [
|
||||||
self.test_env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
self.test_env.Object(target=self.built(with_suffix(p, ".o")), source=p)
|
||||||
for p in TEST_SRCS
|
for p in TEST_SRCS
|
||||||
|
|||||||
Reference in New Issue
Block a user