From 5ac9e5b74873c57860dbe22e04c26c4ee318ccb2 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Thu, 28 Sep 2017 21:08:48 +0800 Subject: Add option /m to enable multiple thread build current in windows it takes ~10 minutes to build a image, so we add /m option to use EDK II build tool's multiple thread build function, it can save about half build time. Cc: zwei4 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: zwei4 --- Platform/BroxtonPlatformPkg/BuildBios.bat | 8 ++++++++ Platform/BroxtonPlatformPkg/BuildIFWI.bat | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'Platform') diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat index 3ac411ed41..1e240e81d1 100644 --- a/Platform/BroxtonPlatformPkg/BuildBios.bat +++ b/Platform/BroxtonPlatformPkg/BuildBios.bat @@ -179,6 +179,14 @@ if /i "%~1"=="/BG" ( goto OptLoop ) +if /i "%~1"=="/m" ( + if defined NUMBER_OF_PROCESSORS ( + set /a build_threads=%NUMBER_OF_PROCESSORS% + ) + shift + goto OptLoop +) + :: Required argument(s) if "%~2"=="" ( echo. & echo -- ERROR: Not Enough Arguments Provided diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat index 1af0bf9d33..504258040e 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -8,6 +8,7 @@ set Arch=X64 set SkipUsageFlag=FALSE set FabId=B set BoardId=MN +set buildthread= set WORKSPACE=%CD% if %WORKSPACE:~-1%==\ ( set WORKSPACE=%WORKSPACE:~0,-1% @@ -104,6 +105,14 @@ if /i "%~1"=="/BG" ( goto OptLoop ) +if /i "%~1"=="/m" ( + set buildthread=/m + echo. + shift + goto OptLoop +) + + :: Require 2 input parameters if "%~2"=="" ( echo. & echo -- ERROR: Not Enough Arguments Provided @@ -120,8 +129,8 @@ echo =========================================================================== echo Build_IFWI: Calling BIOS build Script... echo. -echo - call BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target% -call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target% +echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target% +call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target% if ErrorLevel 1 ( echo echo -- Error Building BIOS & echo. set exitCode=1 -- cgit v1.2.3