Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/tests/SCsub
45980 views
#!/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])