SCsub 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. # Only kept to build the thirdparty library used by the theora and webm
  5. # modules. We now use stb_vorbis for AudioStreamOGGVorbis.
  6. env_vorbis = env_modules.Clone()
  7. # Thirdparty source files
  8. thirdparty_obj = []
  9. if env["builtin_libvorbis"]:
  10. thirdparty_dir = "#thirdparty/libvorbis/"
  11. thirdparty_sources = [
  12. # "analysis.c",
  13. # "barkmel.c",
  14. "bitrate.c",
  15. "block.c",
  16. "codebook.c",
  17. "envelope.c",
  18. "floor0.c",
  19. "floor1.c",
  20. "info.c",
  21. "lookup.c",
  22. "lpc.c",
  23. "lsp.c",
  24. "mapping0.c",
  25. "mdct.c",
  26. "psy.c",
  27. # "psytune.c",
  28. "registry.c",
  29. "res0.c",
  30. "sharedbook.c",
  31. "smallft.c",
  32. "synthesis.c",
  33. # "tone.c",
  34. # "vorbisenc.c",
  35. "vorbisfile.c",
  36. "window.c",
  37. ]
  38. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  39. env_vorbis.Prepend(CPPPATH=[thirdparty_dir])
  40. # also requires libogg
  41. if env["builtin_libogg"]:
  42. env_vorbis.Prepend(CPPPATH=["#thirdparty/libogg"])
  43. env_thirdparty = env_vorbis.Clone()
  44. env_thirdparty.disable_warnings()
  45. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  46. env.modules_sources += thirdparty_obj
  47. # Godot source files
  48. module_obj = []
  49. env_vorbis.add_source_files(module_obj, "*.cpp")
  50. env.modules_sources += module_obj
  51. # Needed to force rebuilding the module files when the thirdparty library is updated.
  52. env.Depends(module_obj, thirdparty_obj)