25 lines
764 B
Python
25 lines
764 B
Python
#!/usr/bin/env python
|
|
from misc.utility.scons_hints import *
|
|
|
|
import glob
|
|
|
|
import test_builders
|
|
|
|
Import("env")
|
|
|
|
# Sources with tests must be explicitly linked first.
|
|
force_link_sources = glob.glob("*/**/*.cpp", recursive=True)
|
|
force_link_header = env.CommandNoCache(
|
|
"force_link.gen.h", env.Value(force_link_sources), env.Run(test_builders.force_link_builder)
|
|
)
|
|
env.Depends(force_link_header, "test_builders.py")
|
|
|
|
tests_obj = []
|
|
if env["scu_build"]:
|
|
# HACK: SCU setup doesn't support recursive/dynamic setup, so we must manually pass the files.
|
|
env.add_source_files(tests_obj, glob.glob(".scu/*.cpp"))
|
|
else:
|
|
env.add_source_files(tests_obj, glob.glob("*.cpp") + force_link_sources)
|
|
|
|
lib = env.add_library("tests", tests_obj)
|
|
env.Prepend(LIBS=[lib])
|