SCsub 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_svg = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. thirdparty_dir = "#thirdparty/thorvg/"
  8. thirdparty_sources = [
  9. # common
  10. "src/common/tvgBezier.cpp",
  11. "src/common/tvgCompressor.cpp",
  12. "src/common/tvgMath.cpp",
  13. "src/common/tvgStr.cpp",
  14. # SVG parser
  15. "src/loaders/svg/tvgSvgCssStyle.cpp",
  16. "src/loaders/svg/tvgSvgLoader.cpp",
  17. "src/loaders/svg/tvgSvgPath.cpp",
  18. "src/loaders/svg/tvgSvgSceneBuilder.cpp",
  19. "src/loaders/svg/tvgSvgUtil.cpp",
  20. "src/loaders/svg/tvgXmlParser.cpp",
  21. "src/loaders/raw/tvgRawLoader.cpp",
  22. "src/loaders/external_png/tvgPngLoader.cpp",
  23. "src/loaders/jpg/tvgJpgd.cpp",
  24. "src/loaders/jpg/tvgJpgLoader.cpp",
  25. # renderer common
  26. "src/renderer/tvgAccessor.cpp",
  27. # "src/renderer/tvgAnimation.cpp",
  28. "src/renderer/tvgCanvas.cpp",
  29. "src/renderer/tvgFill.cpp",
  30. # "src/renderer/tvgGlCanvas.cpp",
  31. "src/renderer/tvgInitializer.cpp",
  32. "src/renderer/tvgLoader.cpp",
  33. "src/renderer/tvgPaint.cpp",
  34. "src/renderer/tvgPicture.cpp",
  35. "src/renderer/tvgRender.cpp",
  36. # "src/renderer/tvgSaver.cpp",
  37. "src/renderer/tvgScene.cpp",
  38. "src/renderer/tvgShape.cpp",
  39. "src/renderer/tvgSwCanvas.cpp",
  40. "src/renderer/tvgTaskScheduler.cpp",
  41. "src/renderer/tvgText.cpp",
  42. # "src/renderer/tvgWgCanvas.cpp",
  43. # renderer sw_engine
  44. "src/renderer/sw_engine/tvgSwFill.cpp",
  45. "src/renderer/sw_engine/tvgSwImage.cpp",
  46. "src/renderer/sw_engine/tvgSwMath.cpp",
  47. "src/renderer/sw_engine/tvgSwMemPool.cpp",
  48. "src/renderer/sw_engine/tvgSwRaster.cpp",
  49. "src/renderer/sw_engine/tvgSwRenderer.cpp",
  50. "src/renderer/sw_engine/tvgSwRle.cpp",
  51. "src/renderer/sw_engine/tvgSwShape.cpp",
  52. "src/renderer/sw_engine/tvgSwStroke.cpp",
  53. ]
  54. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  55. env_svg.Prepend(CPPPATH=[thirdparty_dir + "inc"])
  56. # Enable ThorVG static object linking.
  57. env_svg.Append(CPPDEFINES=["TVG_STATIC"])
  58. env_thirdparty = env_svg.Clone()
  59. env_thirdparty.disable_warnings()
  60. env_thirdparty.Prepend(
  61. CPPPATH=[
  62. thirdparty_dir + "src/common",
  63. thirdparty_dir + "src/loaders/svg",
  64. thirdparty_dir + "src/renderer",
  65. thirdparty_dir + "src/renderer/sw_engine",
  66. thirdparty_dir + "src/loaders/raw",
  67. thirdparty_dir + "src/loaders/external_png",
  68. thirdparty_dir + "src/loaders/jpg",
  69. ]
  70. )
  71. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  72. env.modules_sources += thirdparty_obj
  73. # Godot source files
  74. module_obj = []
  75. env_svg.add_source_files(module_obj, "*.cpp")
  76. env.modules_sources += module_obj
  77. # Needed to force rebuilding the module files when the thirdparty library is updated.
  78. env.Depends(module_obj, thirdparty_obj)