SCsub 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_webm = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. thirdparty_dir = "#thirdparty/libsimplewebm/"
  8. thirdparty_sources = [
  9. "libwebm/mkvparser/mkvparser.cc",
  10. "OpusVorbisDecoder.cpp",
  11. "VPXDecoder.cpp",
  12. "WebMDemuxer.cpp",
  13. ]
  14. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  15. env_webm.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])
  16. # also requires libogg, libvorbis and libopus
  17. if env["builtin_libogg"]:
  18. env_webm.Prepend(CPPPATH=["#thirdparty/libogg"])
  19. if env["builtin_libvorbis"]:
  20. env_webm.Prepend(CPPPATH=["#thirdparty/libvorbis"])
  21. if env["builtin_opus"]:
  22. env_webm.Prepend(CPPPATH=["#thirdparty/opus"])
  23. if env["builtin_libvpx"]:
  24. env_webm.Prepend(CPPPATH=["#thirdparty/libvpx"])
  25. SConscript("libvpx/SCsub")
  26. env_thirdparty = env_webm.Clone()
  27. env_thirdparty.disable_warnings()
  28. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  29. env.modules_sources += thirdparty_obj
  30. # Godot source files
  31. module_obj = []
  32. env_webm.add_source_files(module_obj, "*.cpp")
  33. env.modules_sources += module_obj
  34. # Needed to force rebuilding the module files when the thirdparty library is updated.
  35. env.Depends(module_obj, thirdparty_obj)