From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 40EF1139694 for ; Sun, 30 Apr 2017 20:29:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9C4EDE0DDB; Sun, 30 Apr 2017 20:28:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 510EFE0DCE for ; Sun, 30 Apr 2017 20:28:40 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id EE2423416A1; Sun, 30 Apr 2017 20:28:38 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/4] cmake-utils.eclass: Use eninja from ninja-utils Date: Sun, 30 Apr 2017 22:28:28 +0200 Message-Id: <20170430202830.12974-2-mgorny@gentoo.org> X-Mailer: git-send-email 2.13.0.rc1 In-Reply-To: <20170430202830.12974-1-mgorny@gentoo.org> References: <20170430202830.12974-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 02700127-8405-4e8b-ab59-a8da2aedf717 X-Archives-Hash: d7c6c8b5a52bad6e87ed84ad73c32850 --- eclass/cmake-utils.eclass | 52 +++-------------------------------------------- 1 file 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 -- 2.13.0.rc1