Skip to content

Commit

Permalink
Merge pull request #655 from danteu/cmake_add_parallel
Browse files Browse the repository at this point in the history
cmake: Add `--parallel` build option
  • Loading branch information
nicoulaj committed Oct 8, 2019
2 parents 87e1313 + 4b5da4c commit 8def5f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/_cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -175,6 +177,9 @@ _cmake_on_build() {
elif [[ $words[(($CURRENT - 1))] == --config ]] ; then
# after --build <dir> --config, no idea
return 0
elif [[ $words[(($CURRENT - 1))] == --parallel ]] ; then
# after --build <dir> --parallel
return 0
elif [ "$outofbuild" = true ] ; then
# after --build <dir> --<not a --build option>, suggest other cmake_build_options (like -Wno-dev)
_arguments "$cmake_build_options[@]" && return 0
Expand Down

0 comments on commit 8def5f1

Please sign in to comment.