2023-12-17 07:58:52 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
setlocal
|
|
|
|
pushd "%~dp0"
|
|
|
|
|
|
|
|
set /a last_code=0
|
|
|
|
|
|
|
|
set "build_dir=bin\win"
|
|
|
|
set "out_dir=bin\package\win"
|
|
|
|
|
|
|
|
set /a MEM_PERCENT=90
|
|
|
|
set /a DICT_SIZE_MB=384
|
2023-12-27 01:12:19 +08:00
|
|
|
set "packager=..\..\third-party\deps\win\7za\7za.exe"
|
2023-12-17 07:58:52 +08:00
|
|
|
|
2023-12-27 01:25:53 +08:00
|
|
|
:: use 70%
|
|
|
|
if defined NUMBER_OF_PROCESSORS (
|
|
|
|
set /a THREAD_COUNT=NUMBER_OF_PROCESSORS*70/100
|
|
|
|
) else (
|
|
|
|
set /a THREAD_COUNT=2
|
|
|
|
)
|
|
|
|
|
2023-12-17 07:58:52 +08:00
|
|
|
if not exist "%packager%" (
|
|
|
|
1>&2 echo "[X] packager app wasn't found"
|
|
|
|
set /a last_code=1
|
|
|
|
goto :script_end
|
|
|
|
)
|
|
|
|
|
|
|
|
if not exist "%build_dir%" (
|
|
|
|
1>&2 echo "[X] build folder wasn't found"
|
|
|
|
set /a last_code=1
|
|
|
|
goto :script_end
|
|
|
|
)
|
|
|
|
|
|
|
|
mkdir "%out_dir%"
|
|
|
|
|
2024-02-24 20:58:58 +08:00
|
|
|
set "archive_file=%out_dir%\generate_emu_config-win.7z"
|
2023-12-17 07:58:52 +08:00
|
|
|
if exist "%archive_file%" (
|
2024-02-24 20:58:58 +08:00
|
|
|
del /f /q "%archive_file%"
|
2023-12-17 07:58:52 +08:00
|
|
|
)
|
|
|
|
|
2024-02-24 20:58:58 +08:00
|
|
|
"%packager%" a "%archive_file%" ".\%build_dir%\*" -t7z -slp -ssw -mx -myx -mmemuse=p%MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%DICT_SIZE_MB%m -mmt=%THREAD_COUNT% -mmtf+ -mtm- -mtc- -mta- -mtr+
|
2023-12-17 07:58:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
:script_end
|
|
|
|
popd
|
|
|
|
endlocal & (
|
2024-02-24 20:58:58 +08:00
|
|
|
exit /b %last_code%
|
2023-12-17 07:58:52 +08:00
|
|
|
)
|