1 |
From: David Seifert <soap@g.o> |
2 |
|
3 |
* Using the ninja backend as a default is the only way to |
4 |
massively improve src_compile core utilization, given that |
5 |
it seems unlikely that CMake will ever produce non-recursive |
6 |
Makefiles. |
7 |
|
8 |
For a benchmark, see: |
9 |
http://www.kaizou.org/2016/09/build-benchmark-large-c-project/ |
10 |
--- |
11 |
eclass/cmake-utils.eclass | 12 +++++++++--- |
12 |
1 file changed, 9 insertions(+), 3 deletions(-) |
13 |
|
14 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
15 |
index e64502b3b9b..ed81426ddcc 100644 |
16 |
--- a/eclass/cmake-utils.eclass |
17 |
+++ b/eclass/cmake-utils.eclass |
18 |
@@ -53,7 +53,8 @@ _CMAKE_UTILS_ECLASS=1 |
19 |
# @DESCRIPTION: |
20 |
# Specify a makefile generator to be used by cmake. |
21 |
# At this point only "emake" and "ninja" are supported. |
22 |
-: ${CMAKE_MAKEFILE_GENERATOR:=emake} |
23 |
+# In EAPI 7 and above, the default is set to "ninja", |
24 |
+# whereas in EAPIs below 7, it is set to "emake". |
25 |
|
26 |
# @ECLASS-VARIABLE: CMAKE_MIN_VERSION |
27 |
# @DESCRIPTION: |
28 |
@@ -112,8 +113,13 @@ esac |
29 |
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils |
30 |
|
31 |
case ${EAPI} in |
32 |
- 7) ;; |
33 |
- *) inherit eapi7-ver eutils multilib ;; |
34 |
+ [56]) |
35 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=emake} |
36 |
+ inherit eapi7-ver eutils multilib |
37 |
+ ;; |
38 |
+ *) |
39 |
+ : ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
40 |
+ ;; |
41 |
esac |
42 |
|
43 |
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install |
44 |
-- |
45 |
2.18.0 |