SCsub 912 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/python
  2. Import("env")
  3. env.tests_sources = []
  4. env_tests = env.Clone()
  5. # Include GDNative headers.
  6. if env["module_gdnative_enabled"]:
  7. env_tests.Append(CPPPATH=["#modules/gdnative/include"])
  8. # We must disable the THREAD_LOCAL entirely in doctest to prevent crashes on debugging
  9. # Since we link with /MT thread_local is always expired when the header is used
  10. # So the debugger crashes the engine and it causes weird errors
  11. # Explained in https://github.com/onqtam/doctest/issues/401
  12. if env_tests["platform"] == "windows":
  13. env_tests.Append(CPPDEFINES=[("DOCTEST_THREAD_LOCAL", "")])
  14. # Increase number of addressable sections in object files
  15. # due to doctest's heavy use of templates and macros.
  16. if env_tests.msvc:
  17. env_tests.Append(CCFLAGS=["/bigobj"])
  18. env_tests.add_source_files(env.tests_sources, "*.cpp")
  19. lib = env_tests.add_library("tests", env.tests_sources)
  20. env.Prepend(LIBS=[lib])