BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1785 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: Shifei A Lu Cc: Xiaohu Zhou Cc: Isaac W Oram --- Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat | 21 +++++++++++++++++++-- Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/prebuild.bat | 4 ++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat index f624be03a9..f02472239d 100644 --- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat +++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/bld.bat @@ -10,6 +10,11 @@ REM Run setlocal to take a snapshot of the environment variables. endlocal is c setlocal set SCRIPT_ERROR=0 +@if not defined BINARY_CACHE_PATH ( + echo Info: BINARY_CACHE_PATH is empty, use BinCache as default + SET BINARY_CACHE_PATH=BinCache +) + REM ---- Do NOT use :: for comments Inside of code blocks() ---- ::********************************************************************** @@ -28,6 +33,18 @@ if /I "%1"=="clean" ( goto :EOF ) +@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 +) + shift GOTO :parseCmdLine @@ -86,8 +103,8 @@ echo Build Start echo. echo -------------------------------------------------------------------- echo. -echo build %BUILD_CMD_LINE% --log=%BUILD_LOG% %BUILD_REPORT_FLAGS% -call build %BUILD_CMD_LINE% --log=%BUILD_LOG% %BUILD_REPORT_FLAGS% +echo build %BUILD_CMD_LINE% --log=%BUILD_LOG% %BUILD_REPORT_FLAGS% %BINARY_CACHE_CMD_LINE% +call build %BUILD_CMD_LINE% --log=%BUILD_LOG% %BUILD_REPORT_FLAGS% %BINARY_CACHE_CMD_LINE% echo -------------------------------------------------------------------- echo. echo Build End diff --git a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/prebuild.bat b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/prebuild.bat index d9c1442ea1..4aba30adce 100644 --- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/prebuild.bat +++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/prebuild.bat @@ -182,8 +182,8 @@ set PRE_BUILD_CMD_LINE=%BUILD_CMD_LINE% -D MAX_SOCKET=%MAX_SOCKET% set PRE_BUILD_LOG=%WORKSPACE%\Build\prebuild.log set PRE_BUILD_REPORT=%WORKSPACE%\Build\preBuildReport.txt -echo build %PRE_BUILD_CMD_LINE% -m %BOARD_PKG%\Acpi\BoardAcpiDxe\Dsdt.inf -y %PRE_BUILD_REPORT% --log=%PRE_BUILD_LOG% -call build %PRE_BUILD_CMD_LINE% -m %BOARD_PKG%\Acpi\BoardAcpiDxe\Dsdt.inf -y %PRE_BUILD_REPORT% --log=%PRE_BUILD_LOG% +echo build %PRE_BUILD_CMD_LINE% -m %BOARD_PKG%\Acpi\BoardAcpiDxe\Dsdt.inf -y %PRE_BUILD_REPORT% --log=%PRE_BUILD_LOG% %BINARY_CACHE_CMD_LINE% +call build %PRE_BUILD_CMD_LINE% -m %BOARD_PKG%\Acpi\BoardAcpiDxe\Dsdt.inf -y %PRE_BUILD_REPORT% --log=%PRE_BUILD_LOG% %BINARY_CACHE_CMD_LINE% if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% @REM PSYS == FIX0 -- 2.14.1.windows.1