SCsub 1.1 KB

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