From a3a980eb0d026d1086b65d5c33f2ec7dd63ff742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 26 Jul 2020 15:53:01 +0200 Subject: SCons: Build tests/ and main/ in cloned environments Allows switching `tests=yes`/`no` and rebuilding only tests and main, instead of the whole engine. Co-authored-by: Andrii Doroshenko (Xrayez) --- tests/SCsub | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/SCsub') diff --git a/tests/SCsub b/tests/SCsub index cb1d35b12f..9c32eb8ec3 100644 --- a/tests/SCsub +++ b/tests/SCsub @@ -3,7 +3,13 @@ Import("env") env.tests_sources = [] -env.add_source_files(env.tests_sources, "*.cpp") -lib = env.add_library("tests", env.tests_sources) +env_tests = env.Clone() + +# Enable test framework and inform it of configuration method. +env_tests.Append(CPPDEFINES=["DOCTEST_CONFIG_IMPLEMENT"]) + +env_tests.add_source_files(env.tests_sources, "*.cpp") + +lib = env_tests.add_library("tests", env.tests_sources) env.Prepend(LIBS=[lib]) -- cgit v1.2.3