1 |
commit: 40d24edc8aa68a8a1ce5978330513a1c07c91ab1 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 15 00:03:00 2018 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 10 21:54:03 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40d24edc |
7 |
|
8 |
cmake-utils.eclass: Make ninja default backend in EAPI >= 7 |
9 |
|
10 |
* Using the ninja backend as a default is the only way to |
11 |
massively improve src_compile core utilization, given that |
12 |
it seems unlikely that CMake will ever produce non-recursive |
13 |
Makefiles. |
14 |
|
15 |
See also: |
16 |
http://www.kaizou.org/2016/09/build-benchmark-large-c-project/ |
17 |
|
18 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
19 |
|
20 |
eclass/cmake-utils.eclass | 12 ++++++++++-- |
21 |
1 file changed, 10 insertions(+), 2 deletions(-) |
22 |
|
23 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
24 |
index 73e7f0b73ae..30ee97b99a3 100644 |
25 |
--- a/eclass/cmake-utils.eclass |
26 |
+++ b/eclass/cmake-utils.eclass |
27 |
@@ -50,10 +50,12 @@ _CMAKE_UTILS_ECLASS=1 |
28 |
# Set to enable in-source build. |
29 |
|
30 |
# @ECLASS-VARIABLE: CMAKE_MAKEFILE_GENERATOR |
31 |
+# @DEFAULT_UNSET |
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,7 +114,13 @@ esac |
42 |
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils |
43 |
|
44 |
case ${EAPI} in |
45 |
- 5|6) inherit eutils multilib ;; |
46 |
+ [56]) |
47 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=emake} |
48 |
+ inherit eutils multilib |
49 |
+ ;; |
50 |
+ *) |
51 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
52 |
+ ;; |
53 |
esac |
54 |
|
55 |
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install |