SCsub 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_tinyexr = env_modules.Clone()
  6. # Thirdparty source files
  7. thirdparty_obj = []
  8. # Not unbundled for now as they are not commonly available as shared library
  9. thirdparty_dir = "#thirdparty/tinyexr/"
  10. thirdparty_sources = [
  11. "tinyexr.cc",
  12. ]
  13. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  14. env_tinyexr.Prepend(CPPPATH=[thirdparty_dir])
  15. # Enable threaded loading with C++11.
  16. env_tinyexr.Append(CPPDEFINES=["TINYEXR_USE_THREAD"])
  17. # miniz is an external dependency, we could add it but we can instead rely
  18. # on our existing bundled zlib.
  19. env_tinyexr.Append(CPPDEFINES=[("TINYEXR_USE_MINIZ", 0)])
  20. env_thirdparty = env_tinyexr.Clone()
  21. env_thirdparty.disable_warnings()
  22. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  23. env.modules_sources += thirdparty_obj
  24. # Godot source files
  25. module_obj = []
  26. env_tinyexr.add_source_files(module_obj, "*.cpp")
  27. env.modules_sources += module_obj
  28. # Needed to force rebuilding the module files when the thirdparty library is updated.
  29. env.Depends(module_obj, thirdparty_obj)