Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: kde@g.o, tommy@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/2] cmake-utils.eclass: _ninjaopts_from_makeopts, fix handling of -k
Date: Sun, 28 Feb 2016 19:02:58
Message-Id: 1456686118-28043-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] cmake-utils.eclass: fixes to ninja MAKEOPTS conversion by "Michał Górny"
1 Fix _ninjaopts_from_makeopts to handle -k correctly. Make does not
2 support parameters to -k, while ninja requires one. Therefore, handle
3 only a single '-k' and convert it into '-k 0' (no limit of failing
4 tasks).
5 ---
6 eclass/cmake-utils.eclass | 9 +++++++--
7 1 file changed, 7 insertions(+), 2 deletions(-)
8
9 diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
10 index b607132..f5ed1eb 100644
11 --- a/eclass/cmake-utils.eclass
12 +++ b/eclass/cmake-utils.eclass
13 @@ -659,14 +659,19 @@ _ninjaopts_from_makeopts() {
14 set -- ${MAKEOPTS}
15 while (( $# )); do
16 case $1 in
17 - -j|-l|-k)
18 + -j|-l)
19 ninjaopts+=( $1 $2 )
20 shift 2
21 ;;
22 - -j*|-l*|-k*)
23 + -j*|-l*)
24 ninjaopts+=( $1 )
25 shift 1
26 ;;
27 + -k)
28 + # -k 0 = any number of tasks can fail
29 + ninjaopts+=( $1 0 )
30 + shift 1
31 + ;;
32 *) shift ;;
33 esac
34 done
35 --
36 2.7.2