SCsub 788 B

12345678910111213141516171819202122232425
  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. # Increase number of addressable sections in object files
  12. # due to doctest's heavy use of templates and macros.
  13. if env_tests.msvc:
  14. env_tests.Append(CCFLAGS=["/bigobj"])
  15. env_tests.add_source_files(env.tests_sources, "*.cpp")
  16. lib = env_tests.add_library("tests", env.tests_sources)
  17. env.Prepend(LIBS=[lib])