SCsub 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_theora = env_modules.Clone()
  6. # Thirdparty source files
  7. thirdparty_obj = []
  8. if env["builtin_libtheora"]:
  9. thirdparty_dir = "#thirdparty/libtheora/"
  10. thirdparty_sources = [
  11. # "analyze.c",
  12. # "apiwrapper.c",
  13. "bitpack.c",
  14. # "collect.c",
  15. # "decapiwrapper.c",
  16. "decinfo.c",
  17. "decode.c",
  18. "dequant.c",
  19. # "encapiwrapper.c",
  20. # "encfrag.c",
  21. # "encinfo.c",
  22. # "encode.c",
  23. # "encoder_disabled.c",
  24. # "enquant.c",
  25. # "fdct.c",
  26. "fragment.c",
  27. "huffdec.c",
  28. # "huffenc.c",
  29. "idct.c",
  30. "info.c",
  31. "internal.c",
  32. # "mathops.c",
  33. # "mcenc.c",
  34. "quant.c",
  35. # "rate.c",
  36. "state.c",
  37. # "tokenize.c",
  38. ]
  39. thirdparty_sources_x86 = [
  40. # "x86/mmxencfrag.c",
  41. # "x86/mmxfdct.c",
  42. "x86/mmxfrag.c",
  43. "x86/mmxidct.c",
  44. "x86/mmxstate.c",
  45. # "x86/sse2encfrag.c",
  46. # "x86/sse2fdct.c",
  47. "x86/sse2idct.c",
  48. "x86/x86cpu.c",
  49. # "x86/x86enc.c",
  50. # "x86/x86enquant.c"
  51. "x86/x86state.c",
  52. ]
  53. thirdparty_sources_x86_vc = [
  54. # "x86_vc/mmxencfrag.c",
  55. # "x86_vc/mmxfdct.c",
  56. "x86_vc/mmxfrag.c",
  57. "x86_vc/mmxidct.c",
  58. "x86_vc/mmxstate.c",
  59. "x86_vc/x86cpu.c",
  60. # "x86_vc/x86enc.c",
  61. "x86_vc/x86state.c",
  62. ]
  63. if env["x86_libtheora_opt_gcc"]:
  64. thirdparty_sources += thirdparty_sources_x86
  65. if env["x86_libtheora_opt_vc"]:
  66. thirdparty_sources += thirdparty_sources_x86_vc
  67. if env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]:
  68. env_theora.Append(CPPDEFINES=["OC_X86_ASM"])
  69. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  70. env_theora.Prepend(CPPPATH=[thirdparty_dir])
  71. # also requires libogg and libvorbis
  72. if env["builtin_libogg"]:
  73. env_theora.Prepend(CPPPATH=["#thirdparty/libogg"])
  74. if env["builtin_libvorbis"]:
  75. env_theora.Prepend(CPPPATH=["#thirdparty/libvorbis"])
  76. env_thirdparty = env_theora.Clone()
  77. env_thirdparty.disable_warnings()
  78. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  79. env.modules_sources += thirdparty_obj
  80. # Godot source files
  81. module_obj = []
  82. env_theora.add_source_files(module_obj, "*.cpp")
  83. env.modules_sources += module_obj
  84. # Needed to force rebuilding the module files when the thirdparty library is updated.
  85. env.Depends(module_obj, thirdparty_obj)