SCsub 1.5 KB

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