SCsub 732 B

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