BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1784 Need extend the options in the Kabylake build bld.bat file to support Binary Cache. BINARY_CACHE_PATH: if BINARY_CACHE_PATH is empty, use BinCache as default path Add "cache-produce" and "cache-consume" to command line, Used to generate and use Binary Cache files. Cc: Liming Gao Cc: Bob Feng Cc: Steven Shi Cc: Chasel Chiu Cc: Michael Kubacki Cc: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat index 449660b75d..af397a3115 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/bld.bat @@ -62,6 +62,11 @@ copy /y /b %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg\Fsp_Rebased_S.fd+%WORKSPACE_FSP @SET REBUILD_MODE= @SET BUILD_ROM_ONLY= +@if not defined BINARY_CACHE_PATH ( + echo Info: BINARY_CACHE_PATH is empty, use BinCache as default + SET BINARY_CACHE_PATH=BinCache +) + :: Loop through arguements until all are processed :BUILD_FLAGS_LOOP @@ -87,6 +92,19 @@ copy /y /b %WORKSPACE_FSP_BIN%\KabylakeFspBinPkg\Fsp_Rebased_S.fd+%WORKSPACE_FSP shift goto BUILD_FLAGS_LOOP ) + +@if "%~1" == "cache-produce" ( + SET BINARY_CACHE_CMD_LINE= --hash --binary-destination=%BINARY_CACHE_PATH% + shift + goto BUILD_FLAGS_LOOP +) + +@if "%~1" == "cache-consume" ( + SET BINARY_CACHE_CMD_LINE= --hash --binary-source=%BINARY_CACHE_PATH% + shift + goto BUILD_FLAGS_LOOP +) + :: Unknown build flag. shift goto BUILD_FLAGS_LOOP @@ -99,11 +117,12 @@ goto BUILD_FLAGS_LOOP @echo SILENT_MODE = %SILENT_MODE% @echo REBUILD_MODE = %REBUILD_MODE% @echo BUILD_ROM_ONLY = %BUILD_ROM_ONLY% +@echo BINARY_CACHE_CMD_LINE = %BINARY_CACHE_CMD_LINE% @echo. @if %SILENT_MODE% EQU TRUE goto BldSilent -call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% +call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% %BINARY_CACHE_CMD_LINE% @if %ERRORLEVEL% NEQ 0 goto BldFail @echo. @@ -122,7 +141,7 @@ call %WORKSPACE_PLATFORM%\%PROJECT%\postbuild.bat %BUILD_ROM_ONLY% @echo ************************************************************************ >> Build.log @echo. >> Build.log -call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% 1>>Build.log 2>&1 +call build -n %NUMBER_OF_PROCESSORS% %REBUILD_MODE% %EXT_BUILD_FLAGS% %BINARY_CACHE_CMD_LINE% 1>>Build.log 2>&1 @if %ERRORLEVEL% NEQ 0 goto BldFail @echo. >> Build.log -- 2.14.1.windows.1