zephyr: Support for USER_C_MODULES
Description
Support including user modules like on other ports.
Should be via the USER_C_MODULES variable, in the same way as on other cmake-based ports.
Code Size
No impact
Implementation
I intend to implement this feature and would submit a Pull Request if desirable
Code of Conduct
Yes, I agree
USER_C_MODULES for ESP32
Port, board and/or hardware
esp32
MicroPython version
Master
Reproduction
For building the example modules which come with MicroPython, set USER_C_MODULES to the examples/usercmodule directory for Make, or to examples/usercmodule/micropython.cmake for CMake.
The recent commit b65e89107c0194bfdaf92720786341a2047f36b6 enforces that USER_C_MODULES must point to a directory in the Make system. However, this causes confusion with the documentation, which mixes usage of relative paths and file references for both Make and CMake.
but that's half the battle. We can comment on this committee.
Also, they no longer work as they used to.
Observed behaviour
Examples:
- The following command no longer works with Make after the commit:
cd micropython/ports/esp32
make USER_C_MODULES=../../examples/usercmodule/micropython.cmake
- Instead, absolute paths are required:
make USER_C_MODULES=/dev_iot/opt/upy/micropython/examples/usercmodule/micropython.cmake BOARD=ESP32_GENERIC all