godot-module-template/engine/tests/SCsub
Sara c3f9669b10 Add 'engine/' from commit 'a8e37fc010'
git-subtree-dir: engine
git-subtree-mainline: b74841629e
git-subtree-split: a8e37fc010
2026-03-13 11:22:19 +01:00

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])