Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ThorVG build option (IEC-155) #364

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion thorvg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

list(JOIN 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
Expand Down Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions thorvg/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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 threading support"
default y
help
Enable ThorVG threading support. This option can be disabled if ThorVG is only used from one FreeRTOS task.

menu "Loaders Support"

config THORVG_LOTTIE_LOADER_SUPPORT
bool "Enable Lottie loader support"
default y

config THORVG_TVG_LOADER_SUPPORT
bool "Enable tvg loader support"
default y

config THORVG_SVG_LOADER_SUPPORT
bool "Enable svg loader support"
default y

config THORVG_PNG_LOADER_SUPPORT
bool "Enable png loader support"
default n

config THORVG_JPEG_LOADER_SUPPORT
bool "Enable jpeg loader support"
default n

config THORVG_WEBP_LOADER_SUPPORT
bool "Enable webp loader support"
default n

endmenu

endmenu
2 changes: 1 addition & 1 deletion thorvg/cross_file.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -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','-fno-if-conversion',${MESON_CXX_FLAGS}]
cpp_link_args = [${MESON_LINKER_FLAGS}]

[host_machine]
Expand Down
2 changes: 1 addition & 1 deletion thorvg/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.13.8~1"
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"
Expand Down
4 changes: 2 additions & 2 deletions thorvg/sbom_thorvg.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: thorvg
version: 0.13.8
version: 0.14.9
cpe: cpe:2.3:a:thorvg:thorvg:{}:*:*:*:*:*:*:*
supplier: 'Organization: thorvg <https://github.com/thorvg/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
2 changes: 1 addition & 1 deletion thorvg/thorvg
Submodule thorvg updated 399 files
Loading