Build and use a static library for repl & tests

This commit is contained in:
2022-11-20 22:27:10 -05:00
parent 5cf8a55156
commit 31c7ee156c

View File

@@ -57,14 +57,17 @@ class BuildVariant:
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
for p in LIB_SRCS
]
self.static_lib = self.env.StaticLibrary(self.built("uclisp"), self.lib_objs)
def configure_repl(self):
pgm_objs = [
self.env.Object(target=self.built(with_suffix(p, ".o")), source=p)
for p in PROGRAM_SOURCES
]
self.repl_program = self.env.Program(
self.built("uclisp"), self.lib_objs + pgm_objs
repl_env = self.env.Clone()
repl_env.Append(LIBS=[self.static_lib])
self.repl_program = repl_env.Program(
self.built("uclisp"), pgm_objs,
)
def configure_tests(self):
@@ -73,7 +76,9 @@ class BuildVariant:
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 = [
self.test_env.Object(target=self.built(with_suffix(p, ".o")), source=p)
for p in TEST_SRCS