SCsub 775 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. env.tests_sources = []
  5. env_tests = env.Clone()
  6. # We must disable the THREAD_LOCAL entirely in doctest to prevent crashes on debugging
  7. # Since we link with /MT thread_local is always expired when the header is used
  8. # So the debugger crashes the engine and it causes weird errors
  9. # Explained in https://github.com/onqtam/doctest/issues/401
  10. if env_tests["platform"] == "windows":
  11. env_tests.Append(CPPDEFINES=[("DOCTEST_THREAD_LOCAL", "")])
  12. if env["disable_exceptions"]:
  13. env_tests.Append(CPPDEFINES=["DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS"])
  14. env_tests.add_source_files(env.tests_sources, "*.cpp")
  15. lib = env_tests.add_library("tests", env.tests_sources)
  16. env.Prepend(LIBS=[lib])