2017-08-19 02:21:24 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2020-03-30 06:28:32 +00:00
|
|
|
Import("env")
|
|
|
|
Import("env_modules")
|
2018-10-01 08:59:03 +00:00
|
|
|
|
|
|
|
env_svg = env_modules.Clone()
|
2017-08-19 02:21:24 +00:00
|
|
|
|
|
|
|
# Thirdparty source files
|
2020-12-17 15:01:36 +00:00
|
|
|
|
|
|
|
thirdparty_obj = []
|
|
|
|
|
2022-01-13 12:54:19 +00:00
|
|
|
thirdparty_dir = "#thirdparty/thorvg/"
|
2017-08-19 02:21:24 +00:00
|
|
|
thirdparty_sources = [
|
2022-10-13 15:03:36 +00:00
|
|
|
"src/lib/sw_engine/tvgSwFill.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwImage.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwMath.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwMemPool.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwRaster.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwRenderer.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwRle.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwShape.cpp",
|
|
|
|
"src/lib/sw_engine/tvgSwStroke.cpp",
|
|
|
|
"src/lib/tvgAccessor.cpp",
|
2022-01-13 12:54:19 +00:00
|
|
|
"src/lib/tvgBezier.cpp",
|
|
|
|
"src/lib/tvgCanvas.cpp",
|
|
|
|
"src/lib/tvgFill.cpp",
|
|
|
|
"src/lib/tvgGlCanvas.cpp",
|
|
|
|
"src/lib/tvgInitializer.cpp",
|
|
|
|
"src/lib/tvgLinearGradient.cpp",
|
|
|
|
"src/lib/tvgLoader.cpp",
|
|
|
|
"src/lib/tvgLzw.cpp",
|
|
|
|
"src/lib/tvgPaint.cpp",
|
|
|
|
"src/lib/tvgPicture.cpp",
|
|
|
|
"src/lib/tvgRadialGradient.cpp",
|
|
|
|
"src/lib/tvgRender.cpp",
|
|
|
|
"src/lib/tvgSaver.cpp",
|
|
|
|
"src/lib/tvgScene.cpp",
|
|
|
|
"src/lib/tvgShape.cpp",
|
|
|
|
"src/lib/tvgSwCanvas.cpp",
|
|
|
|
"src/lib/tvgTaskScheduler.cpp",
|
|
|
|
"src/loaders/raw/tvgRawLoader.cpp",
|
2022-03-08 12:56:23 +00:00
|
|
|
"src/loaders/svg/tvgSvgCssStyle.cpp",
|
2022-10-13 15:03:36 +00:00
|
|
|
"src/loaders/svg/tvgSvgLoader.cpp",
|
|
|
|
"src/loaders/svg/tvgSvgPath.cpp",
|
|
|
|
"src/loaders/svg/tvgSvgSceneBuilder.cpp",
|
|
|
|
"src/loaders/svg/tvgSvgUtil.cpp",
|
|
|
|
"src/loaders/svg/tvgXmlParser.cpp",
|
2017-08-19 02:21:24 +00:00
|
|
|
]
|
2022-01-13 12:54:19 +00:00
|
|
|
|
2017-08-19 02:21:24 +00:00
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
2022-01-13 12:54:19 +00:00
|
|
|
env_svg.Prepend(CPPPATH=[thirdparty_dir + "inc"])
|
2017-08-19 02:21:24 +00:00
|
|
|
|
2023-08-08 20:22:11 +00:00
|
|
|
# Enable ThorVG static object linking.
|
|
|
|
env_svg.Append(CPPDEFINES=["TVG_STATIC"])
|
|
|
|
|
2018-10-01 08:59:03 +00:00
|
|
|
env_thirdparty = env_svg.Clone()
|
2018-09-28 11:29:52 +00:00
|
|
|
env_thirdparty.disable_warnings()
|
2022-01-13 12:54:19 +00:00
|
|
|
env_thirdparty.Prepend(
|
|
|
|
CPPPATH=[
|
|
|
|
thirdparty_dir + "src/lib",
|
|
|
|
thirdparty_dir + "src/lib/sw_engine",
|
|
|
|
thirdparty_dir + "src/loaders/raw",
|
|
|
|
thirdparty_dir + "src/loaders/svg",
|
|
|
|
]
|
|
|
|
)
|
2022-10-13 15:03:36 +00:00
|
|
|
# Also requires libpng headers
|
|
|
|
if env["builtin_libpng"]:
|
|
|
|
env_thirdparty.Prepend(CPPPATH=["#thirdparty/libpng"])
|
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
|
|
|
|
env.modules_sources += thirdparty_obj
|
|
|
|
|
|
|
|
# Godot source files
|
|
|
|
|
|
|
|
module_obj = []
|
|
|
|
|
|
|
|
env_svg.add_source_files(module_obj, "*.cpp")
|
|
|
|
env.modules_sources += module_obj
|
2018-09-28 11:29:52 +00:00
|
|
|
|
2020-12-17 15:01:36 +00:00
|
|
|
# Needed to force rebuilding the module files when the thirdparty library is updated.
|
|
|
|
env.Depends(module_obj, thirdparty_obj)
|