From dbf53d1ffbcdf4703ae9e75a9889e88348d30a8f Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Mon, 9 Apr 2012 11:02:53 -0500 Subject: Follow -j [n] documentation, where no [n] means unlimited Change-Id: Icf5561d5405418da6fa132e65d460ebb176b6d12 Reviewed-by: Rohan McGovern --- build | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'build') diff --git a/build b/build index 2649c9c1..1b718b11 100755 --- a/build +++ b/build @@ -137,7 +137,7 @@ sub parse_arguments GetOptionsFromArray(\@args, 'verbose|v:1' => \$self->{'verbose'}, 'continue' => \$self->{'continue'}, - 'jobs|j:1' => \$self->{'jobs'}, + 'jobs|j:0' => \$self->{'jobs'}, 'force-qmake' => \$self->{'force_qmake'}, 'dry-run|n:1' => \$self->{'dry-run'}, 'help|?' => sub { pod2usage(1); }, @@ -239,11 +239,10 @@ sub detect_configuration my $abs_path = abs_path('qtbase/bin'); unshift @PATH, $abs_path; - if ($self->{'jobs'} >= 0) { - $self->{'MAKEOPTS'} = "-j $self->{'jobs'}"; - } else { - $self->{'MAKEOPTS'} = ""; - } + my $opts = ""; + $opts = "-j" if ($self->{'jobs'} >= 0); + $opts .= " $self->{'jobs'}" if ($self->{'jobs'} > 0); + $self->{'MAKEOPTS'} = $opts; $self->{'MAKE'} = $ENV{MAKE} || "make"; if ("$Config{osname}" =~ /mswin/i) { @@ -265,6 +264,9 @@ sub detect_configuration $ENV{'CL'} = $cl; # Remove the -j option, since nmake cannot handle it. $self->{'MAKEOPTS'} = ""; + } elsif ($exe =~ 'jom' && $self->{'jobs'} == 0) { + # Jom currently doesn't handle the -j (unlimited) option, so remove it. + $self->{'MAKEOPTS'} = ""; } if ($exe =~ 'nmake|jom' && $self->{'dry-run'} > 1) { -- cgit v1.2.3