RFCv2: Replacing Make/Kbuild with CMake

Carles Cufi

Hi all,

I am resending this email, slightly modified from its original version, since the work on the build system has resumed and we would like to fish for early feedback regarding the work that Sebastian (who has taken over from Joakim) from Nordic is currently undertaking to move from Make to CMake with the hope of improving it, making it run on all platforms and allowing advanced usage of it with different projects and models. In particular we would like to hear from developers who might have objections with the choice of CMake, since now would be the time to voice them and not once we have a complete port.

As some of you may know, our current build system based on Make and Kbuild doesn't play well with Windows hosts, forcing users wanting to build on Windows to install Unix emulation layers such as MinGW or MSYS2. In the search for a truly cross-platform build system CMake immediately arose as a potential candidate, and after some investigation we've come up with a draft of a proposal to use the CMake build system instead.

Here's a short list of reasons we chose CMake as a candidate to prototype:

* CMake is well-known and established, with good support and frequent releases
* It has reasonably strong support for cross-compilation
* It is fast
* Runs natively on all operating systems
* Supports generation of build files (Make, Ninja) as well as IDE projects
* Has a comprehensive set of cross-platform file utilities (cp, mkdir, rm, ...)
* It's easily extensible and configurable through its scripting system

It's important to state that Kconfig is kept unchanged, being invoked as before from the new build system.

Here is a GitHub PR with the initial prototype:


Sebastian has added a comprehensive list of limitations, usage guides and TODOs in the PR description, please do go over those before asking questions.

We welcome feedback and suggestions as well as patches to support other architectures, boards and samples.



Join devel@lists.zephyrproject.org to automatically receive all group messages.