summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-04-27 18:39:30 +0200
committerMichał Górny <mgorny@gentoo.org>2017-05-16 19:11:27 +0200
commitb15a8079a781e1d9c6a469cbb784613cf209022b (patch)
treeb412a17776cb320c3fea3c7cb53138bcd5e85f5d /eclass/cmake-utils.eclass
parentninja-utils.eclass: Add a new eclass to handle calling ninja (diff)
downloadgentoo-b15a8079a781e1d9c6a469cbb784613cf209022b.tar.gz
gentoo-b15a8079a781e1d9c6a469cbb784613cf209022b.tar.bz2
gentoo-b15a8079a781e1d9c6a469cbb784613cf209022b.zip
cmake-utils.eclass: Use eninja from ninja-utils
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r--eclass/cmake-utils.eclass52
1 files changed, 3 insertions, 49 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 07f719a62a8c..2b3c8d933d1a 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -116,7 +116,8 @@ case ${EAPI} in
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
-inherit toolchain-funcs multilib flag-o-matic eutils multiprocessing versionator
+inherit toolchain-funcs multilib ninja-utils flag-o-matic eutils \
+ multiprocessing versionator
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
@@ -680,44 +681,6 @@ enable_cmake-utils_src_compile() {
cmake-utils_src_make "$@"
}
-_ninjaopts_from_makeopts() {
- if [[ ${NINJAOPTS+set} == set ]]; then
- return 0
- fi
- local ninjaopts=()
- set -- ${MAKEOPTS}
- while (( $# )); do
- case $1 in
- -j|-l)
- if [[ $# -eq 1 || $2 == -* ]]; then
- if [[ $1 == -j ]]; then
- # absurdly high job limit
- ninjaopts+=( $1 9999 )
- else # -l
- # remove load limit (like make does for -l)
- ninjaopts+=( $1 0 )
- fi
- shift 1
- else
- ninjaopts+=( $1 $2 )
- shift 2
- fi
- ;;
- -j*|-l*)
- ninjaopts+=( $1 )
- shift 1
- ;;
- -k)
- # -k 0 = any number of tasks can fail
- ninjaopts+=( $1 0 )
- shift 1
- ;;
- *) shift ;;
- esac
- done
- export NINJAOPTS="${ninjaopts[*]}"
-}
-
# @FUNCTION: _cmake_ninja_src_make
# @INTERNAL
# @DESCRIPTION:
@@ -727,16 +690,7 @@ _cmake_ninja_src_make() {
[[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
- _ninjaopts_from_makeopts
-
- if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then
- set -- ninja ${NINJAOPTS} -v "$@"
- else
- set -- ninja ${NINJAOPTS} "$@"
- fi
-
- echo "$@"
- "$@" || die
+ eninja "$@"
}
# @FUNCTION: _cmake_emake_src_make