From db71bc5b554fcb71aabab0178cc9ce76d27bd9b6 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 7 May 2024 12:01:05 +0900 Subject: [PATCH] infra: add extra build options for flexible ThorVG composition this commit introduces an additional build options: - lottie expressions: this advanced feature in Lottie can significantly increase binary size. Users now have the option to enable or disable it based on their requirements. Note that, this change introduces one config definitions: - THORVG_LOTTIE_EXPRESSIONS_SUPPORT --- meson.build | 66 +++++++++++++++++++++++++---------------------- meson_options.txt | 24 ++++++++++------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/meson.build b/meson.build index 5ebfa185..78407b31 100644 --- a/meson.build +++ b/meson.build @@ -71,11 +71,6 @@ endif if lottie_loader config_h.set10('THORVG_LOTTIE_LOADER_SUPPORT', true) - #Experimental feature, enable it manually - lottie_expressions = false - if lottie_expressions - config_h.set10('THORVG_LOTTIE_EXPRESSIONS_SUPPORT', false) - endif endif if ttf_loader @@ -124,6 +119,13 @@ if get_option('log') == true config_h.set10('THORVG_LOG_ENABLED', true) endif +#Extra +lottie_expressions = lottie_loader and get_option('extra').contains('lottie_expressions') + +if lottie_expressions + config_h.set10('THORVG_LOTTIE_EXPRESSIONS_SUPPORT', true) +endif + #Miscellaneous config_h.set10('WIN32_LEAN_AND_MEAN', true) @@ -148,31 +150,32 @@ endif summary = ''' Summary: - ThorVG version: @0@ - Build Type: @1@ - Prefix: @2@ - Multi-Tasking: @3@ - SIMD Instruction: @4@ - Raster Engine (SW): @5@ - Raster Engine (GL_BETA): @6@ - Raster Engine (WG_BETA): @7@ - Loader (TVG): @8@ - Loader (SVG): @9@ - Loader (TTF): @10@ - Loader (LOTTIE): @11@ - Loader (PNG): @12@ - Loader (JPG): @13@ - Loader (WEBP): @14@ - Saver (TVG): @15@ - Saver (GIF): @16@ - Binding (CAPI): @17@ - Binding (WASM_BETA): @18@ - Log Message: @19@ - Tests: @20@ - Examples: @21@ - Tool (Svg2Tvg): @22@ - Tool (Svg2Png): @23@ - Tool (Lottie2Gif): @24@ + ThorVG version: @0@ + Build Type: @1@ + Prefix: @2@ + Multi-Tasking: @3@ + SIMD Instruction: @4@ + Raster Engine (SW): @5@ + Raster Engine (GL_BETA): @6@ + Raster Engine (WG_BETA): @7@ + Loader (TVG): @8@ + Loader (SVG): @9@ + Loader (TTF): @10@ + Loader (LOTTIE): @11@ + Loader (PNG): @12@ + Loader (JPG): @13@ + Loader (WEBP): @14@ + Saver (TVG): @15@ + Saver (GIF): @16@ + Binding (CAPI): @17@ + Binding (WASM_BETA): @18@ + Log Message: @19@ + Tests: @20@ + Examples: @21@ + Tool (Svg2Tvg): @22@ + Tool (Svg2Png): @23@ + Tool (Lottie2Gif): @24@ + Extra (Lottie Expressions): @25@ '''.format( meson.project_version(), @@ -199,7 +202,8 @@ Summary: get_option('examples'), svg2tvg, svg2png, - lottie2gif + lottie2gif, + lottie_expressions ) message(summary) diff --git a/meson_options.txt b/meson_options.txt index 8549e6e8..8f12b5eb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,9 +39,9 @@ option('tools', description: 'Enable building thorvg tools') option('examples', - type: 'boolean', - value: false, - description: 'Enable building examples') + type: 'boolean', + value: false, + description: 'Enable building examples') option('tests', type: 'boolean', @@ -49,11 +49,17 @@ option('tests', description: 'Enable building Unit Tests') option('log', - type: 'boolean', - value: false, - description: 'Enable log message') + type: 'boolean', + value: false, + description: 'Enable log message') option('static', - type: 'boolean', - value: false, - description: 'Force to use static linking modules in thorvg') + type: 'boolean', + value: false, + description: 'Force to use static linking modules in thorvg') + +option('extra', + type: 'array', + choices: ['', 'lottie_expressions'], + value: ['lottie_expressions'], + description: '"Enable support for exceptionally advanced features') \ No newline at end of file