更新编译方式

This commit is contained in:
星外之神 2022-04-04 00:57:25 +08:00
parent 5ad52c8f49
commit 98e6a8e008
3 changed files with 10 additions and 12 deletions

View File

@ -35,20 +35,18 @@ python main.py
## Windows单文件封装
先在仓库所在文件夹执行:
编译依赖:
- Python >= 3.7
- Python-Pygame >= 1.9
- Nuitka
- MinGW-w64或其他C编译器
- ccache
- python-zstandard可选
在仓库所在文件夹执行:
``` powershell
nuitka --mingw --standalone --onefile --show-progress --show-memory --output-dir=out --windows-icon-from-ico=out/pypvz.ico main.py
```
再及时在单文件编译前于同一文件夹中执行注意执行时间也不要早于Nuitka解析文件结构开始时间
``` powershell
mkdir out\main.dist\pygame
mkdir out\main.dist\source
ln out\freesansbold.ttf out\main.dist\pygame\freesansbold.ttf
New-Item -Path out\main.dist\resources -ItemType Junction -Value resources
New-Item -Path out\main.dist\source\data -ItemType Junction -Value source\data
nuitka --mingw --standalone --onefile --show-progress --show-memory --windows-disable-console --output-dir=out --windows-icon-from-ico=pypvz.ico --include-data-dir=resources=resources --include-data-dir=source/data=source/data --include-data-file=*.ttf=pygame/freesansbold.ttf main.py
```
## 截屏

BIN
freesansbold.ttf Normal file

Binary file not shown.

BIN
pypvz.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB