diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-09-28 21:08:48 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-09-30 09:46:27 +0800 |
commit | 5ac9e5b74873c57860dbe22e04c26c4ee318ccb2 (patch) | |
tree | 6da898d15717749d9a47a4a7e8f3d6e56f1acb8b | |
parent | fa673e3638798c1fab18cf5e3cc4c3036fdb13e7 (diff) | |
download | edk2-platforms-5ac9e5b74873c57860dbe22e04c26c4ee318ccb2.tar.xz |
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 <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: zwei4 <david.wei@intel.com>
-rw-r--r-- | BuildBIOS.bat | 12 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/BuildBios.bat | 8 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/BuildIFWI.bat | 13 |
3 files changed, 29 insertions, 4 deletions
diff --git a/BuildBIOS.bat b/BuildBIOS.bat index 4bb4b03ce3..baf7cdda14 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -12,6 +12,7 @@ set Compiler=/vs13 set Arch=/x64
set FabId=/B
set BoardId=/MN
+set buildthread=
:: Optional arguments
:OptLoop
@@ -86,6 +87,13 @@ if /i "%~1"=="/BG" ( goto OptLoop
)
+if /i "%~1"=="/m" (
+ set buildthread=/m
+ echo.
+ shift
+ goto OptLoop
+)
+
:: Required argument(s)
:: Require 2 input parameters
if "%~2"=="" goto Usage
@@ -96,8 +104,8 @@ set BuildTarget=%~2 :OptLoopEnd
echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
goto Exit
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 |