From c9551fbc68f6961fbb975ef300a9ed53b66e8e7e Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Wed, 2 Mar 2022 00:07:59 +0100 Subject: [PATCH] Build: Use jom to parallelize Windows builds --- .../windows/autobuild_windowsinstaller_1_prepare.ps1 | 6 ++++-- windows/deploy_windows.ps1 | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 b/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 index a57254484d..51c9284faf 100644 --- a/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 +++ b/autobuild/windows/autobuild_windowsinstaller_1_prepare.ps1 @@ -46,6 +46,7 @@ $AqtinstallVersion = "2.0.5" $JackVersion = "1.9.17" $Msvc32Version = "win32_msvc2019" $Msvc64Version = "win64_msvc2019_64" +$JomVersion = "1.1.2" if ( Test-Path -Path $QtDir ) { @@ -68,6 +69,9 @@ else Install-Qt ${Qt32Version} ${Msvc32Version} ${QtDir} } +choco config set cacheLocation $ChocoCacheDir +choco install --no-progress -y jom --version "${JomVersion}" + ################################# ### ONLY ADD JACK IF NEEDED ### @@ -75,8 +79,6 @@ else if ($BuildOption -Eq "jackonwindows") { - choco config set cacheLocation $ChocoCacheDir - echo "Install JACK2 64-bit..." # Install JACK2 64-bit choco install --no-progress -y jack --version "${JackVersion}" diff --git a/windows/deploy_windows.ps1 b/windows/deploy_windows.ps1 index d82cdeb108..9bf235d081 100644 --- a/windows/deploy_windows.ps1 +++ b/windows/deploy_windows.ps1 @@ -234,7 +234,16 @@ Function Build-App "-o", "$BuildPath\Makefile") Set-Location -Path $BuildPath - Invoke-Native-Command -Command "nmake" -Arguments ("$BuildConfig") + if (Get-Command "jom.exe" -ErrorAction SilentlyContinue) + { + echo "Building with jom /J ${Env:NUMBER_OF_PROCESSORS}" + Invoke-Native-Command -Command "jom" -Arguments ("/J", "${Env:NUMBER_OF_PROCESSORS}", "$BuildConfig") + } + else + { + echo "Building with nmake (install Qt jom if you want parallel builds)" + Invoke-Native-Command -Command "nmake" -Arguments ("$BuildConfig") + } Invoke-Native-Command -Command "$Env:QtWinDeployPath" ` -Arguments ("--$BuildConfig", "--compiler-runtime", "--dir=$DeployPath\$BuildArch", "$BuildPath\$BuildConfig\$AppName.exe")