Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: eclass/
Date: Thu, 26 May 2016 08:13:16
Message-Id: 1464250369.583a1bead82e2a20d396c425a2d74b7b8f9b93a9.kensington@gentoo
1 commit: 583a1bead82e2a20d396c425a2d74b7b8f9b93a9
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 28 18:42:18 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Thu May 26 08:12:49 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=583a1bea
7
8 cmake-utils.eclass: _ninjaopts_from_makeopts, fix plain '-j' and '-l'
9
10 Fix the _ninjaopts_from_makeopts to handle no-parameter '-j' and '-l'
11 options correctly and convert them to appropriate parametrized ninja
12 options.
13
14 eclass/cmake-utils.eclass | 15 +++++++++++++--
15 1 file changed, 13 insertions(+), 2 deletions(-)
16
17 diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
18 index d035e04..02b06bb 100644
19 --- a/eclass/cmake-utils.eclass
20 +++ b/eclass/cmake-utils.eclass
21 @@ -660,8 +660,19 @@ _ninjaopts_from_makeopts() {
22 while (( $# )); do
23 case $1 in
24 -j|-l)
25 - ninjaopts+=( $1 $2 )
26 - shift 2
27 + if [[ $# -eq 1 || $2 == -* ]]; then
28 + if [[ $1 == -j ]]; then
29 + # absurdly high job limit
30 + ninjaopts+=( $1 9999 )
31 + else # -l
32 + # remove load limit (like make does for -l)
33 + ninjaopts+=( $1 0 )
34 + fi
35 + shift 1
36 + else
37 + ninjaopts+=( $1 $2 )
38 + shift 2
39 + fi
40 ;;
41 -j*|-l*)
42 ninjaopts+=( $1 )