From 4b5da4cbe01e35ea966b03f0b675ab3376e3c113 Mon Sep 17 00:00:00 2001 From: Daniel Teunis Date: Mon, 7 Oct 2019 00:25:06 +0200 Subject: [PATCH] cmake: Add `--parallel` build option --- src/_cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_cmake b/src/_cmake index aa86a0b..0f1bdbc 100644 --- a/src/_cmake +++ b/src/_cmake @@ -132,6 +132,7 @@ _cmake_on_build() { '--target[specify build target]' '--clean-first[build target clean first]' '--config[For multi-configuration tools]' + '--parallel[maximum number of build processes]' '--use-stderr') local -a undescribed_build_extras i=1 @@ -157,6 +158,7 @@ _cmake_on_build() { if [[ ${undescribed_build_extras[(r)$words[$i]]} == $words[$i] ]] ; then continue ; fi if [[ $words[(($i - 1))] == --target ]] ; then continue ; fi if [[ $words[(($i - 1))] == --config ]] ; then continue ; fi + if [[ $words[(($i - 1))] == --parallel ]] ; then continue ; fi outofbuild=true done if (( $dashdashposition > 0 )) ; then @@ -175,6 +177,9 @@ _cmake_on_build() { elif [[ $words[(($CURRENT - 1))] == --config ]] ; then # after --build --config, no idea return 0 + elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then + # after --build --parallel + return 0 elif [ "$outofbuild" = true ] ; then # after --build --, suggest other cmake_build_options (like -Wno-dev) _arguments "$cmake_build_options[@]" && return 0