Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: Re: [gentoo-dev] [PATCH 1/2] cmake-utils.eclass: Make ninja default backend in EAPI >= 7
Date: Thu, 26 Jul 2018 07:21:58
Message-Id: 1532589703.730.2.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/2] cmake-utils.eclass: Make ninja default backend in EAPI >= 7 by soap@gentoo.org
1 W dniu czw, 26.07.2018 o godzinie 08∶35 +0200, użytkownik
2 soap@g.o napisał:
3 > From: David Seifert <soap@g.o>
4 >
5 > * Using the ninja backend as a default is the only way to
6 > massively improve src_compile core utilization, given that
7 > it seems unlikely that CMake will ever produce non-recursive
8 > Makefiles.
9 >
10 > For a benchmark, see:
11 > http://www.kaizou.org/2016/09/build-benchmark-large-c-project/
12
13 For the record, 'core utilization' or speed in general is a poor
14 argument. You shouldn't have brought it because it will bring
15 completely unnecessary bikeshed to this thread. Gentoo developers will
16 argue about it not because it could benefit Gentoo in any way
17 but because someone is wrong on the Internet!
18
19 The primary reason for using Ninja is making verbose build output
20 readable, in particular getting a lot of pointless nested verbose echos
21 out of it.
22
23 > ---
24 > eclass/cmake-utils.eclass | 12 +++++++++---
25 > 1 file changed, 9 insertions(+), 3 deletions(-)
26 >
27 > diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
28 > index e64502b3b9b..ed81426ddcc 100644
29 > --- a/eclass/cmake-utils.eclass
30 > +++ b/eclass/cmake-utils.eclass
31 > @@ -53,7 +53,8 @@ _CMAKE_UTILS_ECLASS=1
32 > # @DESCRIPTION:
33 > # Specify a makefile generator to be used by cmake.
34 > # At this point only "emake" and "ninja" are supported.
35 > -: ${CMAKE_MAKEFILE_GENERATOR:=emake}
36 > +# In EAPI 7 and above, the default is set to "ninja",
37 > +# whereas in EAPIs below 7, it is set to "emake".
38 >
39 > # @ECLASS-VARIABLE: CMAKE_MIN_VERSION
40 > # @DESCRIPTION:
41 > @@ -112,8 +113,13 @@ esac
42 > inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
43 >
44 > case ${EAPI} in
45 > - 7) ;;
46 > - *) inherit eapi7-ver eutils multilib ;;
47 > + [56])
48 > + : ${CMAKE_MAKEFILE_GENERATOR:=emake}
49 > + inherit eapi7-ver eutils multilib
50 > + ;;
51 > + *)
52 > + : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
53 > + ;;
54 > esac
55 >
56 > EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
57
58 --
59 Best regards,
60 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature