mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
Merge pull request #91901 from akien-mga/scons-thorvg-webp-loader-opt-out
thorvg: Disable webp loader if corresponding module is disabled
This commit is contained in:
commit
c4889e4793
@ -26,7 +26,6 @@ thirdparty_sources = [
|
||||
"src/loaders/raw/tvgRawLoader.cpp",
|
||||
# image loaders
|
||||
"src/loaders/external_png/tvgPngLoader.cpp",
|
||||
"src/loaders/external_webp/tvgWebpLoader.cpp",
|
||||
"src/loaders/jpg/tvgJpgd.cpp",
|
||||
"src/loaders/jpg/tvgJpgLoader.cpp",
|
||||
# renderer common
|
||||
@ -59,6 +58,10 @@ thirdparty_sources = [
|
||||
"src/renderer/sw_engine/tvgSwStroke.cpp",
|
||||
]
|
||||
|
||||
if env["module_webp_enabled"]:
|
||||
thirdparty_sources += ["src/loaders/external_webp/tvgWebpLoader.cpp"]
|
||||
env_svg.Append(CPPDEFINES=["THORVG_WEBP_LOADER_SUPPORT"])
|
||||
|
||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||
|
||||
env_svg.Prepend(CPPPATH=[thirdparty_dir + "inc"])
|
||||
@ -76,12 +79,15 @@ env_thirdparty.Prepend(
|
||||
thirdparty_dir + "src/renderer/sw_engine",
|
||||
thirdparty_dir + "src/loaders/raw",
|
||||
thirdparty_dir + "src/loaders/external_png",
|
||||
thirdparty_dir + "src/loaders/external_webp",
|
||||
thirdparty_dir + "src/loaders/jpg",
|
||||
"#thirdparty/libpng",
|
||||
"#thirdparty/libwebp/src",
|
||||
]
|
||||
)
|
||||
if env["builtin_libpng"]:
|
||||
env_thirdparty.Prepend(CPPPATH=["#thirdparty/libpng"])
|
||||
if env["module_webp_enabled"]:
|
||||
env_thirdparty.Prepend(CPPPATH=[thirdparty_dir + "src/loaders/external_webp"])
|
||||
if env["builtin_libwebp"]:
|
||||
env_thirdparty.Prepend(CPPPATH=["#thirdparty/libwebp/src"])
|
||||
|
||||
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
|
||||
env.modules_sources += thirdparty_obj
|
||||
|
4
thirdparty/thorvg/inc/config.h
vendored
4
thirdparty/thorvg/inc/config.h
vendored
@ -5,9 +5,11 @@
|
||||
#define THORVG_SVG_LOADER_SUPPORT
|
||||
#define THORVG_PNG_LOADER_SUPPORT
|
||||
#define THORVG_JPG_LOADER_SUPPORT
|
||||
#define THORVG_WEBP_LOADER_SUPPORT
|
||||
#define THORVG_THREAD_SUPPORT
|
||||
|
||||
// Added conditionally if webp module is enabled.
|
||||
//#define THORVG_WEBP_LOADER_SUPPORT
|
||||
|
||||
// For internal debugging:
|
||||
//#define THORVG_LOG_ENABLED
|
||||
|
||||
|
4
thirdparty/thorvg/update-thorvg.sh
vendored
4
thirdparty/thorvg/update-thorvg.sh
vendored
@ -38,9 +38,11 @@ cat << EOF > ../inc/config.h
|
||||
#define THORVG_SVG_LOADER_SUPPORT
|
||||
#define THORVG_PNG_LOADER_SUPPORT
|
||||
#define THORVG_JPG_LOADER_SUPPORT
|
||||
#define THORVG_WEBP_LOADER_SUPPORT
|
||||
#define THORVG_THREAD_SUPPORT
|
||||
|
||||
// Added conditionally if webp module is enabled.
|
||||
//#define THORVG_WEBP_LOADER_SUPPORT
|
||||
|
||||
// For internal debugging:
|
||||
//#define THORVG_LOG_ENABLED
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user