Skip to content

Commit

Permalink
build: fix handling of -j when not given a number
Browse files Browse the repository at this point in the history
  • Loading branch information
edgomez committed Apr 6, 2016
1 parent 48e06e1 commit aac8892
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ parse_args()
shift
;;
-j|--jobs)
MAKE_TASKS="$2"
MAKE_TASKS=$(printf "%d" "$2" >/dev/null 2>&1 && printf "$2" || printf "$MAKE_TASKS")
shift
;;
--enable-*)
Expand Down Expand Up @@ -232,6 +232,9 @@ cmake_boolean_option()
# Let's process the user's wishes
# ---------------------------------------------------------------------------

MAKE_TASKS=$(num_cpu)
MAKE=$(make_name)

features_set_to_autodetect
parse_args "$@"

Expand All @@ -240,12 +243,6 @@ if [ $PRINT_HELP -ne 0 ] ; then
exit 1
fi

if [ $MAKE_TASKS -lt 1 ] ; then
MAKE_TASKS=$(num_cpu)
fi

MAKE=$(make_name)

CMAKE_MORE_OPTIONS=""
for i in $FEATURES; do
eval cmake_boolean_option USE_$i \$FEAT_$i
Expand Down

0 comments on commit aac8892

Please sign in to comment.