Skip to content
0.2.0-dev Download ZIP
25 lines ·764 B Raw
1#!/usr/bin/env python
2from misc.utility.scons_hints import *
3
4import glob
5
6import test_builders
7
8Import("env")
9
10# Sources with tests must be explicitly linked first.
11force_link_sources = glob.glob("*/**/*.cpp", recursive=True)
12force_link_header = env.CommandNoCache(
13 "force_link.gen.h", env.Value(force_link_sources), env.Run(test_builders.force_link_builder)
14)
15env.Depends(force_link_header, "test_builders.py")
16
17tests_obj = []
18if env["scu_build"]:
19 # HACK: SCU setup doesn't support recursive/dynamic setup, so we must manually pass the files.
20 env.add_source_files(tests_obj, glob.glob(".scu/*.cpp"))
21else:
22 env.add_source_files(tests_obj, glob.glob("*.cpp") + force_link_sources)
23
24lib = env.add_library("tests", tests_obj)
25env.Prepend(LIBS=[lib])