Building Zephyr like there's no CMake


Paul Sokolovsky
 

Hello,

This post is long overdue, it should have been posted at the time of
1.10 release. It's possible that now it's not much relevant for many
people which undergo a pain^W chore^W process of converting their
workflow to "type more than one command to go along with CMake".

Anyway, there's a patch,
https://github.com/zephyrproject-rtos/zephyr/pull/5201 , which
introduces a "zephyr-make" wrapper which allows you to build Zephyr
(in-tree) applications (samples and tests) largely as before:

zephyr-make BOARD=frdm_k64f CONF=prj_frdm_k64f.conf
zephyr-make BOARD=qemu_cortex_m3 # Uses prj.conf
zephyr-make # Uses qemu_x86

As the review comments show, the common assessment was that if the
mainline switches to CMake, then it makes sense to switch to it, and
don't promote any wrappers. I expect that the PR will be closed, but I
intend to push any fixes made to that branch.

And, as a note to maintainers, if you were concerned that with the
documentation switching to use "ninja" in examples, "make" support for
CMake build process will go unexercised and untested, no worries,
people still use it ;-).


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Carles Cufi
 

Hi Paul,

-----Original Message-----
Subject: [Zephyr-devel] Building Zephyr like there's no CMake

Hello,

Anyway, there's a patch,
https://github.com/zephyrproject-rtos/zephyr/pull/5201 , which
introduces a "zephyr-make" wrapper which allows you to build Zephyr
(in-tree) applications (samples and tests) largely as before:

zephyr-make BOARD=frdm_k64f CONF=prj_frdm_k64f.conf zephyr-make
BOARD=qemu_cortex_m3 # Uses prj.conf zephyr-make # Uses qemu_x86

As the review comments show, the common assessment was that if the
mainline switches to CMake, then it makes sense to switch to it, and
don't promote any wrappers. I expect that the PR will be closed, but I
intend to push any fixes made to that branch.
Thanks for the script, I suspect it can become popular among some of the Zephyr userbase.
My suggestion would be to have this script live outside the Zephyr tree, but possibly link to it from the "Getting Started" page in a note, or perhaps in a new section called "Tips and tricks" or "Additional tools".

And, as a note to maintainers, if you were concerned that with the
documentation switching to use "ninja" in examples, "make" support for
CMake build process will go unexercised and untested, no worries, people
still use it ;-).
Well this is actually unrelated to your script, because you can always change zephyr-make to use Ninja under the hood :)

Carles


Sebastian Boe
 

Hi,

these scripts are great (albeit not upstreamable),
these are my aliases, I combine them with "export BOARD":

alias t='~/zephyr/scripts/sanitycheck -T$PWD'
alias gn='git clean -ffdx'
alias cmake='cmake -GNinja'
alias cgnumake='\cmake'
alias cb='rm -rf b && cmake -Bb -H. && cgnumake --build b'

________________________________________
From: zephyr-devel-bounces@... <zephyr-devel-bounces@...> on behalf of Cufi, Carles <Carles.Cufi@...>
Sent: Tuesday, 6 February 2018 2:38:04 PM
To: Paul Sokolovsky; devel@...
Subject: Re: [Zephyr-devel] Building Zephyr like there's no CMake

Hi Paul,

-----Original Message-----
Subject: [Zephyr-devel] Building Zephyr like there's no CMake

Hello,

Anyway, there's a patch,
https://github.com/zephyrproject-rtos/zephyr/pull/5201 , which
introduces a "zephyr-make" wrapper which allows you to build Zephyr
(in-tree) applications (samples and tests) largely as before:

zephyr-make BOARD=frdm_k64f CONF=prj_frdm_k64f.conf zephyr-make
BOARD=qemu_cortex_m3 # Uses prj.conf zephyr-make # Uses qemu_x86

As the review comments show, the common assessment was that if the
mainline switches to CMake, then it makes sense to switch to it, and
don't promote any wrappers. I expect that the PR will be closed, but I
intend to push any fixes made to that branch.
Thanks for the script, I suspect it can become popular among some of the Zephyr userbase.
My suggestion would be to have this script live outside the Zephyr tree, but possibly link to it from the "Getting Started" page in a note, or perhaps in a new section called "Tips and tricks" or "Additional tools".

And, as a note to maintainers, if you were concerned that with the
documentation switching to use "ninja" in examples, "make" support for
CMake build process will go unexercised and untested, no worries, people
still use it ;-).
Well this is actually unrelated to your script, because you can always change zephyr-make to use Ninja under the hood :)

Carles
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel