Skip to content

RFC Use Ninja as build tool for CMake-based packages

Adrian Perez de Castro buildroot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest7 patches 3 repliesIn review
  2. v1 RFC2 patches 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7package/ninja: do not require cmakepackage/ninja/ninja.mk+35 -10 replies
2/7package/pkg-cmake.mk: use ninja instead of makepackage/pkg-cmake.mk+14 -101 reply
3/7package/musepack: use MUSEPACK_NINJA_OPTSpackage/musepack/musepack.mk+1 -11 reply
4/7package/mariadb: use HOST_MARIADB_NINJA_OPTSpackage/mariadb/mariadb.mk+1 -10 replies
5/7package/kf5/kf5-extra-cmake-modules: do not build documentationpackage/kf5/kf5-extra-cmake-modules/kf5-extra-cmake-modules.mk+5 -00 replies
6/7package/libcorrect: avoid multiple rules for same targetpackage/libcorrect/libcorrect.mk+2 -00 replies
7/7package/racehound: add patch to support building with ninjapackage/racehound/0002-CMake-Support-non-Make-generators-e.g.-Ninja.patch+112 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Buildroot] [PATCH RFC v2 0/7] Use Ninja as build tool for CMake-based packages

Hi all,

Here's a new version of the patch set to use Ninja for all CMake packages. It is still incomplete (missing documentation, a couple of commits need better commit logs, etc.) so I will be still using the "RFC" tag =)

This is what I wrote when I sent the initial version:

Quoted 7 lines

In order to avoid the circular dependency of host-ninja requiring itself, ninja.mk gets changed to use host-generic-package with a build command that plainly runs the compiler on the set of sources we know are needed to build a minimal usable version of it under Unix-y systems. This is basically the list of sources that CMake would have picked (as per the CMakeLists.txt file) passed straight to $(HOSTCXX).

Quoted 6 lines

The next change modifies pkg-cmake.mk to always pass -GNinja and removes the $(<PKG>_INSTALL[_STAGING,_TARGET]_OPTS) variables, because when using Ninja the "install/fast" targets are not generated by CMake (those are an internal detail of the Makefile generator, it seems). For consistency with the Meson package infrastructure variables $(NINJA), $(<PKG>_NINJA_ENV) and $(NINJA_OPTS) are honored by the default set of build/install commands.

While the main changes remain the same, this v2 includes a few fixes for packages which were needed to make them build using Ninja, and much more
testing: out of the 306 packages which use CMake today, I have been able to successfully have 205 of them built. I will follow-up with another email commenting more on this, and with a defconfig attached.

At this point I am confident that we can get all the packages built with CMake without loss of functionality. Only 5 packages out of 205 needing minor tweaks is a *very* good sign, IMO.

Cheers,
-Adrian

Adrian Perez de Castro (7):
package/ninja: do not require cmake package/pkg-cmake.mk: use ninja instead of make package/musepack: use MUSEPACK_NINJA_OPTS package/mariadb: use HOST_MARIADB_NINJA_OPTS package/kf5/kf5-extra-cmake-modules: do not build documentation package/libcorrect: avoid multiple rules for same target package/racehound: add patch to support building with ninja

 .../kf5-extra-cmake-modules.mk                |   5 +
 package/libcorrect/libcorrect.mk              |   2 +
 package/mariadb/mariadb.mk                    |   2 +-
 package/musepack/musepack.mk                  |   2 +-
 package/ninja/ninja.mk                        |  36 +++++-
 package/pkg-cmake.mk                          |  24 ++--
 ...pport-non-Make-generators-e.g.-Ninja.patch | 112 ++++++++++++++++++
 7 files changed, 170 insertions(+), 13 deletions(-)
 create mode 100644 package/racehound/0002-CMake-Support-non-Make-generators-e.g.-Ninja.patch
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot