Skip to content

Commit

Permalink
cmake-utils.eclass: Make ninja default backend in EAPI >= 7
Browse files Browse the repository at this point in the history
* 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/

Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
SoapGentoo authored and a17r committed Dec 10, 2018
1 parent 8d440a0 commit 40d24ed
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions eclass/cmake-utils.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 eutils multilib
;;
*)
: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
;;
esac

EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
Expand Down

0 comments on commit 40d24ed

Please sign in to comment.