summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2018-07-14 17:03:00 -0700
committerAndreas Sturmlechner <asturm@gentoo.org>2018-10-07 20:36:34 +0200
commit42f0d29b4942e60b70fc708ad67d96d839e87c70 (patch)
tree6c8d7bc6f41e30d2ad118e922901e0abfe25164f
parent6335d10acbef18bd8f7ade80296f9b2560fcdb94 (diff)
downloadkde-42f0d29b4942e60b70fc708ad67d96d839e87c70.tar.gz
kde-42f0d29b4942e60b70fc708ad67d96d839e87c70.tar.bz2
kde-42f0d29b4942e60b70fc708ad67d96d839e87c70.zip
cmake-utils.eclass: Make ninja default backend in EAPI >= 7
* Using the ninja backend as a default is the only way to massively improve src_compile core utilization, given that it seems unlikely that CMake will ever produce non-recursive Makefiles. See also: http://www.kaizou.org/2016/09/build-benchmark-large-c-project/
-rw-r--r--eclass/cmake-utils.eclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 73e7f0b73ae..a75574505c1 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -50,10 +50,12 @@ _CMAKE_UTILS_ECLASS=1
# Set to enable in-source build.
# @ECLASS-VARIABLE: CMAKE_MAKEFILE_GENERATOR
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Specify a makefile generator to be used by cmake.
# At this point only "emake" and "ninja" are supported.
-: ${CMAKE_MAKEFILE_GENERATOR:=emake}
+# In EAPI 7 and above, the default is set to "ninja",
+# whereas in EAPIs below 7, it is set to "emake".
# @ECLASS-VARIABLE: CMAKE_MIN_VERSION
# @DESCRIPTION:
@@ -112,7 +114,13 @@ esac
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
case ${EAPI} in
- 5|6) inherit eutils multilib ;;
+ [56])
+ : ${CMAKE_MAKEFILE_GENERATOR:=emake}
+ inherit eapi7-ver eutils multilib
+ ;;
+ *)
+ : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+ ;;
esac
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install