zephyr: Use cmake ExternalProject to build libmicropython.a. - #6392
MaureenHelm wants to merge 2 commits into
Conversation
fc43316 to
1c1778d
Compare
|
Sorry, I completely missed this. I didn't look at this PR in detail but in general it sounds like a good idea. Would it make it even better to use the approach in #6473 where MicroPython provides cmake fragments (py/py.cmake, py/mkrules.cmake, extmod/extmod.cmake) and can build as a cmake target, rather than external project? |
Yes I think it could, that's what caught my attention in #6473. I'll try to prototype something on top of that PR, although I don't think that exercise needs to gate accepting this PR. |
Removes zephyr port build files that aren't being used anymore. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Rework the zephyr port's build infrastructure to build libmicropython.a
with a cmake ExternalProject, instead of invoking cmake from a Makefile
(which was an awkward thing to do because cmake typically generates
Makefiles).
This change makes it possible to build the zephyr port like most other
zephyr applications using west or cmake directly. It simplifies building
with extra cmake arguments, such as specifying an alternate conf file or
adding an Arduino shield. It also enables building the zephyr port
anywhere in the host file system, which will allow regressing across
multiple boards with the zephyr sanitycheck script.
To build with west:
$ west build -b frdm_k64f ~/micropython/ports/zephyr
To build with cmake:
$ mkdir build && cd build
$ cmake -DBOARD=frdm_k64f ~/micropython/ports/zephyr
$ make
To build the minimal configuration:
$ west build -b frdm_k64f -- -DCONF_FILE=prj_minimal.conf
To build with a zephyr-supported Arduino shield:
$ west build -b frdm_k64f -- -DSHIELD=frdm_kw41z
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
1c1778d to
f3ad4f6
Compare
|
I had a more detailed look at this. It is good and I would merge it but I think #6542 (pure cmake solution) is better. |
|
I agree the pure cmake solution in #6542 is better. |
Rework the zephyr port's build infrastructure to build libmicropython.a
with a cmake ExternalProject, instead of invoking cmake from a Makefile
(which was an awkward thing to do because cmake typically generates
Makefiles).
This change makes it possible to build the zephyr port like most other
zephyr applications using west or cmake directly. It simplifies building
with extra cmake arguments, such as specifying an alternate conf file or
adding an Arduino shield. It also enables building the zephyr port
anywhere in the host file system, which will allow regressing across
multiple boards with the zephyr sanitycheck script.
To build with west:
To build with cmake:
To build the minimal configuration:
To build with a zephyr-supported Arduino shield:
Signed-off-by: Maureen Helm maureen.helm@nxp.com