diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-22 09:47:28 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-26 09:08:58 +0000 |
commit | df3090cb05817277b0dd3586e9e2e7a673955a24 (patch) | |
tree | 752b64bcd2d3c2a21c0386829213338ba10c6665 | |
parent | a29ca6139902e0eba6bf5f6b46eb56d54fb59ea0 (diff) |
qt5_tool: Add config keys for jobs and incredibuild
Change-Id: Ic8f51beea43899de0301a49490e08bba184dd10c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rwxr-xr-x | bin/qt5_tool | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/bin/qt5_tool b/bin/qt5_tool index 1f2cdb2..6d05ddf 100755 --- a/bin/qt5_tool +++ b/bin/qt5_tool @@ -90,6 +90,8 @@ branch: 'dev', 'stable', 'release' or other configureArguments: Arguments to configure skip: List of Qt modules to exclude from building shadowBuildPostfix: Postfix to use for shadow build directory. +incredibuild: Use Incredibuild (true/false) +jobs: Number of jobs to be run simultaneously Example: shadowBuildPostfix=-build @@ -156,6 +158,8 @@ my $minGW = 0; sub checkMake { + my $useIncredibuild = readQt5ToolConfigBool('incredibuild') || defined($optIncredibuild); + my $jobs = readQt5ToolConfigInt('jobs', -1); if ($os == $OS_WINDOWS) { if (which('g++')) { $make = 'mingw32-make'; @@ -163,10 +167,11 @@ sub checkMake @makeArgs = ('/s', '/l'); $makeForceArg = '/k'; my $jom; - $jom = which('ibjom') if defined($optIncredibuild); + $jom = which('ibjom') if $useIncredibuild; $jom = which('jom') unless defined($jom); if (defined $jom) { $make = $jom; + unshift(@makeArgs, '/J', $jobs) if $jobs > 0; } else { $make = 'nmake'; # Switch cl compiler to multicore @@ -178,11 +183,14 @@ sub checkMake } } # jom } # !MinGW - } elsif (defined($optIncredibuild)) { - my $ib_console = '/opt/incredibuild/bin/ib_console'; - if (-x $ib_console && system($ib_console, 'echo', 'Testing') == 0) { - unshift(@makeArgs, $make, '-j', '40'); - $make = $ib_console; + } else { + unshift(@makeArgs, '-j', $jobs) if $jobs > 0; + if ($useIncredibuild) { + my $ib_console = '/opt/incredibuild/bin/ib_console'; + if (-x $ib_console) { + unshift(@makeArgs, $make); + $make = $ib_console; + } } } } # sub checkMake @@ -472,6 +480,13 @@ sub readQt5ToolConfigBool return (length($value) > 0 && ($value eq '1' || $value =~ /true/i)) ? 1 : 0; } +sub readQt5ToolConfigInt +{ + my ($key, $default) = @_; + my $value = readQt5ToolConfig($key); + return length($value) > 0 ? int($value) : $default; +} + sub shadowBuildFolder { my $shadowBuildPostfix = readQt5ToolConfig('shadowBuildPostfix'); |