1 |
commit: 42f0d29b4942e60b70fc708ad67d96d839e87c70 |
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: Sun Oct 7 18:36:34 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=42f0d29b |
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 |
eclass/cmake-utils.eclass | 12 ++++++++++-- |
19 |
1 file changed, 10 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
22 |
index 73e7f0b73a..a75574505c 100644 |
23 |
--- a/eclass/cmake-utils.eclass |
24 |
+++ b/eclass/cmake-utils.eclass |
25 |
@@ -50,10 +50,12 @@ _CMAKE_UTILS_ECLASS=1 |
26 |
# Set to enable in-source build. |
27 |
|
28 |
# @ECLASS-VARIABLE: CMAKE_MAKEFILE_GENERATOR |
29 |
+# @DEFAULT_UNSET |
30 |
# @DESCRIPTION: |
31 |
# Specify a makefile generator to be used by cmake. |
32 |
# At this point only "emake" and "ninja" are supported. |
33 |
-: ${CMAKE_MAKEFILE_GENERATOR:=emake} |
34 |
+# In EAPI 7 and above, the default is set to "ninja", |
35 |
+# whereas in EAPIs below 7, it is set to "emake". |
36 |
|
37 |
# @ECLASS-VARIABLE: CMAKE_MIN_VERSION |
38 |
# @DESCRIPTION: |
39 |
@@ -112,7 +114,13 @@ esac |
40 |
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils |
41 |
|
42 |
case ${EAPI} in |
43 |
- 5|6) inherit eutils multilib ;; |
44 |
+ [56]) |
45 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=emake} |
46 |
+ inherit eapi7-ver eutils multilib |
47 |
+ ;; |
48 |
+ *) |
49 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
50 |
+ ;; |
51 |
esac |
52 |
|
53 |
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install |