cmake-utils.eclass: _ninjaopts_from_makeopts, fix handling of -k
authorMichał Górny <mgorny@gentoo.org>
Sun, 28 Feb 2016 18:38:38 +0000 (19:38 +0100)
committerMichał Górny <mgorny@gentoo.org>
Thu, 26 May 2016 08:09:57 +0000 (10:09 +0200)
Fix _ninjaopts_from_makeopts to handle -k correctly. Make does not
support parameters to -k, while ninja requires one. Therefore, handle
only a single '-k' and convert it into '-k 0' (no limit of failing
tasks).

eclass/cmake-utils.eclass

index 5958230e468566dd0c5ab0a025629283e218875c..d035e0459f23bc40eddecb789a94b8cc03571c96 100644 (file)
@@ -659,14 +659,19 @@ _ninjaopts_from_makeopts() {
        set -- ${MAKEOPTS}
        while (( $# )); do
                case $1 in
-                       -j|-l|-k)
+                       -j|-l)
                                ninjaopts+=( $1 $2 )
                                shift 2
                                ;;
-                       -j*|-l*|-k*)
+                       -j*|-l*)
                                ninjaopts+=( $1 )
                                shift 1
                                ;;
+                       -k)
+                               # -k 0 = any number of tasks can fail
+                               ninjaopts+=( $1 0 )
+                               shift 1
+                               ;;
                        *) shift ;;
                esac
        done