-
Notifications
You must be signed in to change notification settings - Fork 93
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
thorvg: add component of thorvg (IEC-115) #332
thorvg: add component of thorvg (IEC-115) #332
Conversation
cc5b0e5
to
c126b36
Compare
@espressif2022 instead of copying the thorvg source code, can we use git submodule? |
can we also provide an example for this? |
LGTM overall, aside from the points mentioned above. Please also add an SBOM file, there is an example in |
Regarding an example, I agree it would be useful. You can do something very simple which only shows the API usage. For instance, see this other PR where I'm adding a FreeType example: #320. |
ok, modify this in my fork repository, and then use submodule here. |
Okay, I'll add an example referring to this. |
@espressif2022 regarding this comment,
What changes did you have to make to the upstream project, could you please show a diff? Thorvg can usually be ported to different platforms without modifying its source code, so I wonder if we could do the same here. |
Mainly cmake compilation changes, because thorvg is built with meson and should be incompatible with our ESP-IDF. |
Yeah, using the original repo is the best option. This will make releasing new thorvg versions simpler, since we will only need to update the submodule pointer. Can you describe what these "cmake compilation changes" were? As I understand, you have added component CMakeLists.txt, which is outside of thorvg directory. So is there anything extra that needs to be done inside thorvg itself? |
The internal build system uses Meson: meson.build. Additionally, some internal function names are causing compilation issues(my self-test seems to be fine), as mentioned here: Issue 2062. |
Both options are okay:
Let me know if you meet any issue or need any help. |
|
I think you can use CMake |
I tested to use a fixed config file .
I encountered a strdup error, despite having included cstring in the header file.
|
Can you try adding -D_GNU_SOURCE to the compilation flags of thorvg? ( |
f3c36dc
to
afdc57a
Compare
replaced now. |
Added, riscv32 in P4 and xtensa in s3 are tested. |
Both riscv32 on P4 and xtensa on s3 have been tested. |
afdc57a
to
1ce095a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall
thorvg/CMakeLists.txt
Outdated
|
||
file(APPEND ${TVG_CROSS_CFG} " | ||
[host_machine] | ||
system = 'android' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, why set the host to android?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, why set the host to android?
if get_option('threads') == true and host_machine.system() != 'windows' and host_machine.system() != 'android'
thread_dep = meson.get_compiler('cpp').find_library('pthread')
thorvg_lib_dep += [thread_dep]
endif
To solve the thread_dep
error, but later added -Dthreads=false
, I think it is better to write freertos
here now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do provide pthreads library, so enabling thread support should work fine. What was the exact error you got here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do provide pthreads library, so enabling thread support should work fine. What was the exact error you got here?
Project name: thorvg
Project version: 0.13.6
C++ compiler for the host machine: /home/xuxin/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-g++ (gcc 13.2.0 "riscv32-esp-elf-g++ (crosstool-NG esp-13.2.0_20240530) 13.2.0")
C++ linker for the host machine: /home/xuxin/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-g++ ld.bfd 13.2.0
C++ compiler for the build machine: ccache c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C++ linker for the build machine: c++ ld.bfd 2.38
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: Generic
Host machine cpu: esp
Target machine cpu family: Generic
Target machine cpu: esp
Configuring config.h using configuration
../../../../thorvg/src/meson.build:47:43: ERROR: C++ shared or static library 'pthread' not found
A full log can be found at /home/xuxin/esp_work/idf-extra-components_fork/thorvg/examples/thorvg-example/build/thorvg_build/meson-logs/meson-log.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this should be possible to solve by adding pthread component library to the linker flags.
We can keep this as a follow-up, I think it's okay to not fix this in the current MR. (Provided that thorvg is used from one FreeRTOS task only.)
@espressif2022 Please fix the CI pipeline and squash the commits before merge. |
esp32_p4_function_ev_board_noglib: | ||
version: ">=1.2.0" | ||
rules: | ||
- if: "target == esp32p4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when this example is used for a different target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when this example is used for a different target?
It will compile and report an error.
Because PPA
has been added here, and only the BSP of esp32_p4_function_ev_board
has the bsp_display_new_with_handles
function, so the example only supports P4.
3a273fa
to
331a7f3
Compare
INCLUDE_DIRS "." | ||
PRIV_REQUIRES esp_lcd esp_timer esp_driver_ppa) | ||
|
||
idf_component_get_property(board_lib espressif__esp32_p4_function_ev_board_noglib COMPONENT_LIB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@espzav will you fix the build warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What warning is there? I will try it on the board tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What warning is there? I will try it on the board tomorrow.
@espzav , this warning.
espressif__esp32_p4_function_ev_board_noglib/esp32_p4_function_ev_board.c:33:31: warning: 'tp' defined but not used [-Wunused-variable]
33 | static esp_lcd_touch_handle_t tp; // LCD touch handle
331a7f3
to
c8cf0ea
Compare
Checklist
url
field definedChange description
1: Add component of thorvg.
2: Example is here .
3: The structure refers to this PR of LVGL.