Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 1/2] cmake-utils.eclass: Make ninja default backend in EAPI >= 7
Date: Thu, 13 Sep 2018 09:55:14
Message-Id: 4070615.ndDgQoSst6@tux200s
In Reply to: [gentoo-dev] [PATCH 1/2] cmake-utils.eclass: Make ninja default backend in EAPI >= 7 by soap@gentoo.org
1 ---Original Message---
2 On Thursday, 26 July 2018 at 08:35, soap@g.o wrote:
3
4 > From: David Seifert <soap@g.o>
5 >
6 > * Using the ninja backend as a default is the only way to
7 > massively improve src_compile core utilization, given that
8 > it seems unlikely that CMake will ever produce non-recursive
9 > Makefiles.
10 >
11 > For a benchmark, see:
12 > http://www.kaizou.org/2016/09/build-benchmark-large-c-project/
13 > ---
14 > eclass/cmake-utils.eclass | 12 +++++++++---
15 > 1 file changed, 9 insertions(+), 3 deletions(-)
16 >
17 > diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
18 > index e64502b3b9b..ed81426ddcc 100644
19 > --- a/eclass/cmake-utils.eclass
20 > +++ b/eclass/cmake-utils.eclass
21 > @@ -53,7 +53,8 @@ _CMAKE_UTILS_ECLASS=1
22 > # @DESCRIPTION:
23 > # Specify a makefile generator to be used by cmake.
24 > # At this point only "emake" and "ninja" are supported.
25 > -: ${CMAKE_MAKEFILE_GENERATOR:=emake}
26 > +# In EAPI 7 and above, the default is set to "ninja",
27 > +# whereas in EAPIs below 7, it is set to "emake".
28 >
29 > # @ECLASS-VARIABLE: CMAKE_MIN_VERSION
30 > # @DESCRIPTION:
31 > @@ -112,8 +113,13 @@ esac
32 > inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
33 >
34 > case ${EAPI} in
35 > - 7) ;;
36 > - *) inherit eapi7-ver eutils multilib ;;
37 > + [56])
38 > + : ${CMAKE_MAKEFILE_GENERATOR:=emake}
39 > + inherit eapi7-ver eutils multilib
40 > + ;;
41 > + *)
42 > + : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
43 > + ;;
44 > esac
45 >
46 > EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
47 > --
48 > 2.18.0
49
50 +1 fwiw, I've been testing this in an overlay branch and it seems to work fine
51 so far (no ninja related errors on those packages I rebuilt).