SCsub 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_vorbis = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. if env["builtin_libvorbis"]:
  8. thirdparty_dir = "#thirdparty/libvorbis/"
  9. thirdparty_sources = [
  10. # "analysis.c",
  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. # "vorbisenc.c",
  33. "vorbisfile.c",
  34. "window.c",
  35. ]
  36. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  37. env_vorbis.Prepend(CPPPATH=[thirdparty_dir])
  38. # also requires libogg
  39. if env["builtin_libogg"]:
  40. env_vorbis.Prepend(CPPPATH=["#thirdparty/libogg"])
  41. env_thirdparty = env_vorbis.Clone()
  42. env_thirdparty.disable_warnings()
  43. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  44. env.modules_sources += thirdparty_obj
  45. # Godot source files
  46. module_obj = []
  47. env_vorbis.add_source_files(module_obj, "*.cpp")
  48. env.modules_sources += module_obj
  49. # Needed to force rebuilding the module files when the thirdparty library is updated.
  50. env.Depends(module_obj, thirdparty_obj)