lvgl
lvgl copied to clipboard
cmake: Add missing "REQUIRES main" for ESP-IDF
Description of the feature or fix
Hi there,
I realised that it may be necessary to add REQUIRES main in idf_component_register() in env_support/cmake/esp.cmake. Otherwise if I need to use any external libraries such as freetype2, the LVGL adapters like lv_freetype.c will complain about missing headers.
For example, I have a project that needs FreeType2, and I wrote a interface library (see here: https://github.com/huming2207/esp-ft2). I make it as a Git submodule and clone it into components directory of my ESP-IDF project. Meanwhile I also have a LVGL copy as a submodule in the components directory together. Now, if I enable the LV_USE_FREETYPE and start playing with the FreeType stuff, the compiler will complain something like this:
../components/lvgl/src/extra/libs/freetype/lv_freetype.c:12:10: fatal error: ft2build.h: No such file or directory
Even if I get the main/CMakeLists.txt to REQUIRE both lvgl and freetype, when compiling, the compiler will still complain the same error.
That is due to the LVGL component doesn't know the existence of my FreeType component. So we need to let lvgl component to know the existence of the project's main component, and since main component knows freetype, then lvgl component also knows the freetype.
Regards, Jackson
Checkpoints
- [x] Follow the styling guide
- [x] Run
code-format.pyfrom thescriptsfolder. astyle needs to be installed. - [x] Update the documentation
Hmm... we originally did not specify REQUIRES main because of https://github.com/lvgl/lvgl/issues/2403. I think merging this would cause that issue to regress.
Hmm... we originally did not specify
REQUIRES mainbecause of https://github.com/lvgl/lvgl/issues/2403. I think merging this would cause that issue to regress.
Okay... what about PRIV_REQUIRES? I'll have a try tomorrow.
@embeddedt PRIV_REQUIRES works for me.
Meanwhile if say both PRIV_REQUIRES or REQUIRES are both not doable, then what should I do to include the freetype dependency anyway? Maybe add freetype to main component? But then I guess LVGL still won't know the existence of the freetype...
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
@C47D Could you take a look at this when you have some time?
Hi, yes I will take a look at it.
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
Not stale.
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
We need some feedback on this pull request.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.