SCsub 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. # "barkmel.c",
  12. "bitrate.c",
  13. "block.c",
  14. "codebook.c",
  15. "envelope.c",
  16. "floor0.c",
  17. "floor1.c",
  18. "info.c",
  19. "lookup.c",
  20. "lpc.c",
  21. "lsp.c",
  22. "mapping0.c",
  23. "mdct.c",
  24. "psy.c",
  25. # "psytune.c",
  26. "registry.c",
  27. "res0.c",
  28. "sharedbook.c",
  29. "smallft.c",
  30. "synthesis.c",
  31. # "tone.c",
  32. "vorbisfile.c",
  33. "window.c",
  34. ]
  35. if env.editor_build:
  36. thirdparty_sources += [
  37. "analysis.c",
  38. "vorbisenc.c",
  39. ]
  40. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  41. env_vorbis.Prepend(CPPEXTPATH=[thirdparty_dir])
  42. # also requires libogg
  43. if env["builtin_libogg"]:
  44. env_vorbis.Prepend(CPPEXTPATH=["#thirdparty/libogg"])
  45. env_thirdparty = env_vorbis.Clone()
  46. env_thirdparty.disable_warnings()
  47. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  48. env.modules_sources += thirdparty_obj
  49. # Godot source files
  50. module_obj = []
  51. env_vorbis.add_source_files(module_obj, "*.cpp")
  52. env.modules_sources += module_obj
  53. # Needed to force rebuilding the module files when the thirdparty library is updated.
  54. env.Depends(module_obj, thirdparty_obj)