-
Notifications
You must be signed in to change notification settings - Fork 108
/
package_win.bat
54 lines (41 loc) · 1.11 KB
/
package_win.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@echo off
setlocal
pushd "%~dp0"
set /a last_code=0
set "build_base_dir=build\win"
set "out_dir=build\package\win"
set /a MEM_PERCENT=90
set /a DICT_SIZE_MB=384
set "packager=third-party\deps\win\7za\7za.exe"
:: use 70%
if defined NUMBER_OF_PROCESSORS (
set /a THREAD_COUNT=NUMBER_OF_PROCESSORS*70/100
) else (
set /a THREAD_COUNT=2
)
if not exist "%packager%" (
1>&2 echo [X] packager app wasn't found
set /a last_code=1
goto :script_end
)
if "%~1"=="" (
1>&2 echo [X] missing build folder
set /a last_code=1
goto :script_end
)
if not exist "%build_base_dir%\%~1" (
1>&2 echo [X] build folder wasn't found
set /a last_code=1
goto :script_end
)
mkdir "%out_dir%\%~1"
set "archive_file=%out_dir%\%~1\emu-win-%~1.7z"
if exist "%archive_file%" (
del /f /q "%archive_file%"
)
"%packager%" a "%archive_file%" ".\%build_base_dir%\%~1" -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+
:script_end
popd
endlocal & (
exit /b %last_code%
)