From 870c49e42661696b47cc754fbbfba02a897060ee Mon Sep 17 00:00:00 2001 From: xuxin Date: Mon, 19 Aug 2024 21:09:53 +0800 Subject: [PATCH 1/7] feat: Add ThorVG build option --- thorvg/CMakeLists.txt | 43 ++++++++++++++++++++++++++++++- thorvg/Kconfig | 55 ++++++++++++++++++++++++++++++++++++++++ thorvg/cross_file.txt.in | 2 +- thorvg/idf_component.yml | 2 +- thorvg/sbom_thorvg.yml | 4 +-- thorvg/thorvg | 2 +- 6 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 thorvg/Kconfig diff --git a/thorvg/CMakeLists.txt b/thorvg/CMakeLists.txt index f683b7e41b..32aa437217 100644 --- a/thorvg/CMakeLists.txt +++ b/thorvg/CMakeLists.txt @@ -4,7 +4,46 @@ set(TVG_INC_DIR thorvg/src/bindings/capi) set(TVG_SUBDIR "${CMAKE_CURRENT_SOURCE_DIR}/thorvg") set(TVG_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/thorvg_build") set(TVG_CROSS_CFG "${CMAKE_CURRENT_BINARY_DIR}/thorvg_build/cross_file.txt") -set(TVG_THREADS "true") + +set(TVG_LOADERS_OPTION "") + +if(CONFIG_THORVG_LOTTIE_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "lottie") +endif() + +if(CONFIG_THORVG_SVG_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "svg") +endif() + +if(CONFIG_THORVG_TVG_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "tvg") +endif() + +if(CONFIG_THORVG_PNG_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "png") +endif() + +if(CONFIG_THORVG_JPEG_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "jpg") +endif() + +if(CONFIG_THORVG_WEBP_LOADER_SUPPORT) + list(APPEND TVG_LOADERS_OPTION "webp") +endif() + +string(REPLACE ";" "," TVG_LOADERS_OPTION "${TVG_LOADERS_OPTION}") + +if(CONFIG_THORVG_LOG_ENABLED) + set(TVG_LOG "true") +else() + set(TVG_LOG "false") +endif() + +if(CONFIG_THORVG_THREAD_ENABLED) + set(TVG_THREADS "true") +else() + set(TVG_THREADS "false") +endif() idf_component_register( SRCS dummy.c @@ -61,6 +100,8 @@ ExternalProject_Add(${TVG_LIB}_target -Ddefault_library=static # build static library -Db_staticpic=false # no -fPIC -Dthreads=${TVG_THREADS} + -Dlog=${TVG_LOG} # allow log output + -Dloaders=${TVG_LOADERS_OPTION} # Pass the loaders option to Meson BUILD_COMMAND ninja -C ${TVG_BUILD_DIR} INSTALL_COMMAND "" BUILD_BYPRODUCTS ${TVG_BUILD_DIR}/src/${TVG_LIB}.a diff --git a/thorvg/Kconfig b/thorvg/Kconfig new file mode 100644 index 0000000000..c0b0cef877 --- /dev/null +++ b/thorvg/Kconfig @@ -0,0 +1,55 @@ +menu "ThorVG Support Options" + + config THORVG_LOG_ENABLED + bool "Enable ThorVG log" + default n + help + Enable ThorVG log. + + config THORVG_THREAD_ENABLED + bool "Enable ThorVG thread" + default n + help + Enable ThorVG thread. + + menu "Loaders Support" + + config THORVG_LOTTIE_LOADER_SUPPORT + bool "Enable Lottie loader support" + default y + help + Enable Lottie loader support. + + config THORVG_TVG_LOADER_SUPPORT + bool "Enable tvg loader support" + default y + help + Enable TVG loader support. + + config THORVG_SVG_LOADER_SUPPORT + bool "Enable svg loader support" + default y + help + Enable SVG loader support. + + config THORVG_PNG_LOADER_SUPPORT + bool "Enable png loader support" + default n + help + Enable PNG loader support. + + config THORVG_JPEG_LOADER_SUPPORT + bool "Enable jpeg loader support" + default n + help + Enable JPEG loader support. + + config THORVG_WEBP_LOADER_SUPPORT + bool "Enable webp loader support" + default n + help + Enable WEBP loader support. + + endmenu + +endmenu diff --git a/thorvg/cross_file.txt.in b/thorvg/cross_file.txt.in index b896109087..ba468a8c56 100644 --- a/thorvg/cross_file.txt.in +++ b/thorvg/cross_file.txt.in @@ -7,7 +7,7 @@ ld = '${CMAKE_LINKER}' strip = '${CMAKE_STRIP}' [built-in options] -cpp_args = ['-D_GNU_SOURCE','-D__linux__',${MESON_CXX_FLAGS}] +cpp_args = ['-D_GNU_SOURCE','-D__linux__','-Wno-format',${MESON_CXX_FLAGS}] cpp_link_args = [${MESON_LINKER_FLAGS}] [host_machine] diff --git a/thorvg/idf_component.yml b/thorvg/idf_component.yml index b522000fb0..7db6e76c98 100644 --- a/thorvg/idf_component.yml +++ b/thorvg/idf_component.yml @@ -1,4 +1,4 @@ -version: "0.13.8~1" +version: "0.14.6" description: "ThorVG is an open-source graphics library designed for creating vector-based scenes and animations" url: https://github.com/espressif/idf-extra-components/tree/master/thorvg repository: "https://github.com/espressif/idf-extra-components.git" diff --git a/thorvg/sbom_thorvg.yml b/thorvg/sbom_thorvg.yml index 11aa3c715e..3a4635ffc5 100644 --- a/thorvg/sbom_thorvg.yml +++ b/thorvg/sbom_thorvg.yml @@ -1,7 +1,7 @@ name: thorvg -version: 0.13.8 +version: 0.14.6 cpe: cpe:2.3:a:thorvg:thorvg:{}:*:*:*:*:*:*:* supplier: 'Organization: thorvg ' description: ThorVG is an open-source graphics library designed for creating vector-based scenes and animations. url: https://github.com/thorvg/thorvg -hash: 30aa742b26e35e170f927c8e5ebdaa68dea6f48f +hash: 81a0fbfd590873b21e53c3af77969c71d3d9b586 diff --git a/thorvg/thorvg b/thorvg/thorvg index 30aa742b26..81a0fbfd59 160000 --- a/thorvg/thorvg +++ b/thorvg/thorvg @@ -1 +1 @@ -Subproject commit 30aa742b26e35e170f927c8e5ebdaa68dea6f48f +Subproject commit 81a0fbfd590873b21e53c3af77969c71d3d9b586 From 21f1cd044a73b5ec05d0576f9bb218ee2e5146bc Mon Sep 17 00:00:00 2001 From: xuxin Date: Wed, 18 Sep 2024 21:46:49 +0800 Subject: [PATCH 2/7] feat: update to v0.14.9 --- thorvg/idf_component.yml | 2 +- thorvg/sbom_thorvg.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thorvg/idf_component.yml b/thorvg/idf_component.yml index 7db6e76c98..be29fe9a16 100644 --- a/thorvg/idf_component.yml +++ b/thorvg/idf_component.yml @@ -1,4 +1,4 @@ -version: "0.14.6" +version: "0.14.9" description: "ThorVG is an open-source graphics library designed for creating vector-based scenes and animations" url: https://github.com/espressif/idf-extra-components/tree/master/thorvg repository: "https://github.com/espressif/idf-extra-components.git" diff --git a/thorvg/sbom_thorvg.yml b/thorvg/sbom_thorvg.yml index 3a4635ffc5..8973a009b2 100644 --- a/thorvg/sbom_thorvg.yml +++ b/thorvg/sbom_thorvg.yml @@ -1,5 +1,5 @@ name: thorvg -version: 0.14.6 +version: 0.14.9 cpe: cpe:2.3:a:thorvg:thorvg:{}:*:*:*:*:*:*:* supplier: 'Organization: thorvg ' description: ThorVG is an open-source graphics library designed for creating vector-based scenes and animations. From 2be767781e2eab04a5a111b50084a2cd6baae578 Mon Sep 17 00:00:00 2001 From: espressif2022 <111102666+espressif2022@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:56:35 +0800 Subject: [PATCH 3/7] Apply suggestions from code review string replace to list Co-authored-by: Ivan Grokhotkov --- thorvg/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thorvg/CMakeLists.txt b/thorvg/CMakeLists.txt index 32aa437217..332d70d9d7 100644 --- a/thorvg/CMakeLists.txt +++ b/thorvg/CMakeLists.txt @@ -31,7 +31,7 @@ if(CONFIG_THORVG_WEBP_LOADER_SUPPORT) list(APPEND TVG_LOADERS_OPTION "webp") endif() -string(REPLACE ";" "," TVG_LOADERS_OPTION "${TVG_LOADERS_OPTION}") +list(JOIN TVG_LOADERS_OPTION "," TVG_LOADERS_OPTION) if(CONFIG_THORVG_LOG_ENABLED) set(TVG_LOG "true") From 6b78542099e72e326195f07daff002a66c665423 Mon Sep 17 00:00:00 2001 From: espressif2022 <111102666+espressif2022@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:57:22 +0800 Subject: [PATCH 4/7] Apply suggestions from code review thread->threading support Co-authored-by: Ivan Grokhotkov --- thorvg/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thorvg/Kconfig b/thorvg/Kconfig index c0b0cef877..c1a9769208 100644 --- a/thorvg/Kconfig +++ b/thorvg/Kconfig @@ -7,7 +7,7 @@ menu "ThorVG Support Options" Enable ThorVG log. config THORVG_THREAD_ENABLED - bool "Enable ThorVG thread" + bool "Enable ThorVG threading support" default n help Enable ThorVG thread. From 79f94c7d3caa041ffe02e999bb18060a7408d6ce Mon Sep 17 00:00:00 2001 From: espressif2022 <111102666+espressif2022@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:58:01 +0800 Subject: [PATCH 5/7] Apply suggestions from code review update description. Co-authored-by: Ivan Grokhotkov --- thorvg/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thorvg/Kconfig b/thorvg/Kconfig index c1a9769208..ef2cdf6d5a 100644 --- a/thorvg/Kconfig +++ b/thorvg/Kconfig @@ -10,7 +10,7 @@ menu "ThorVG Support Options" bool "Enable ThorVG threading support" default n help - Enable ThorVG thread. + Enable ThorVG threading support. This option can be disabled if ThorVG is only used from one FreeRTOS task. menu "Loaders Support" From 370d2705d67558dfd7415b87caad73efbefb5c2a Mon Sep 17 00:00:00 2001 From: xuxin Date: Thu, 19 Sep 2024 17:01:03 +0800 Subject: [PATCH 6/7] feat: delete useless help text --- thorvg/Kconfig | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/thorvg/Kconfig b/thorvg/Kconfig index ef2cdf6d5a..5aa9116ac9 100644 --- a/thorvg/Kconfig +++ b/thorvg/Kconfig @@ -17,38 +17,26 @@ menu "ThorVG Support Options" config THORVG_LOTTIE_LOADER_SUPPORT bool "Enable Lottie loader support" default y - help - Enable Lottie loader support. config THORVG_TVG_LOADER_SUPPORT bool "Enable tvg loader support" default y - help - Enable TVG loader support. config THORVG_SVG_LOADER_SUPPORT bool "Enable svg loader support" default y - help - Enable SVG loader support. config THORVG_PNG_LOADER_SUPPORT bool "Enable png loader support" default n - help - Enable PNG loader support. config THORVG_JPEG_LOADER_SUPPORT bool "Enable jpeg loader support" default n - help - Enable JPEG loader support. config THORVG_WEBP_LOADER_SUPPORT bool "Enable webp loader support" default n - help - Enable WEBP loader support. endmenu From 359f79b4241a4aee3ff60b6ada8e6b52fb8f1998 Mon Sep 17 00:00:00 2001 From: xuxin Date: Thu, 19 Sep 2024 17:34:29 +0800 Subject: [PATCH 7/7] feat: add build flags --- thorvg/Kconfig | 2 +- thorvg/cross_file.txt.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thorvg/Kconfig b/thorvg/Kconfig index 5aa9116ac9..10da335057 100644 --- a/thorvg/Kconfig +++ b/thorvg/Kconfig @@ -8,7 +8,7 @@ menu "ThorVG Support Options" config THORVG_THREAD_ENABLED bool "Enable ThorVG threading support" - default n + default y help Enable ThorVG threading support. This option can be disabled if ThorVG is only used from one FreeRTOS task. diff --git a/thorvg/cross_file.txt.in b/thorvg/cross_file.txt.in index ba468a8c56..3bc0a1c3d2 100644 --- a/thorvg/cross_file.txt.in +++ b/thorvg/cross_file.txt.in @@ -7,7 +7,7 @@ ld = '${CMAKE_LINKER}' strip = '${CMAKE_STRIP}' [built-in options] -cpp_args = ['-D_GNU_SOURCE','-D__linux__','-Wno-format',${MESON_CXX_FLAGS}] +cpp_args = ['-D_GNU_SOURCE','-D__linux__','-Wno-format','-fno-if-conversion',${MESON_CXX_FLAGS}] cpp_link_args = [${MESON_LINKER_FLAGS}] [host_machine]