windows: Use the MicroPython logo as application icon.

Add a .ico file with common icon image size, created from
vector-logo-2.png, and embed it into the resulting executable.

Signed-off-by: stijn <stijn@ignitron.net>
This commit is contained in:
stijn 2022-11-15 15:13:29 +01:00 committed by Damien George
parent 03eae48847
commit 958c6d917d
7 changed files with 22 additions and 0 deletions

1
.gitattributes vendored
View File

@ -8,6 +8,7 @@
# These are binary so should never be modified by git.
*.a binary
*.ico binary
*.png binary
*.jpg binary
*.dxf binary

BIN
logo/vector-logo-2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

View File

@ -102,3 +102,9 @@ test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
test_full: test
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) $(PYTHON) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) $(RUN_TESTS_SKIP) -d basics float micropython
$(BUILD)/$(PROG): $(BUILD)/micropython.res
$(BUILD)/%.res: %.rc
$(ECHO) "WINDRES $<"
$(Q)$(WINDRES) $< -O coff -o $@

View File

@ -135,3 +135,13 @@ For more info, see https://www.winehq.org/docs/wineusr-guide/cui-programs .
If built without line editing and history capabilities
(MICROPY_USE_READLINE=0), the resulting binary can be run using the standard
`wine` tool.
Generating the icon file
------------------------
The windows builds use a .ico file for the executable logo.
To generate such file from a .png file use ImageMagick, as was done for the icons in the logo/ directory:
magick convert vector-logo-2.png -define icon:auto-resize="256,128,96,64,48,32,16" vector-logo-2.ico
Note that for versions prior to 7.0 the command is `convert` instead of `magick convert`.

View File

@ -0,0 +1 @@
app ICON "../../logo/vector-logo-2.ico"

View File

@ -103,6 +103,9 @@
<ClInclude Include="$(PyBaseDir)ports\windows\*.h" />
<ClInclude Include="$(PyBaseDir)ports\windows\msvc\*.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="micropython.rc" />
</ItemGroup>
<Import Project="msvc/genhdr.targets" />
<Import Project="$(CustomPropsFile)" Condition="exists('$(CustomPropsFile)')" />
<Target Name="GenerateMicroPythonSources" BeforeTargets="BuildGenerateSources" DependsOnTargets="GenerateHeaders;FreezeModules">

View File

@ -54,6 +54,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
AR = $(CROSS_COMPILE)ar
WINDRES = $(CROSS_COMPILE)windres
MAKE_MANIFEST = $(PYTHON) $(TOP)/tools/makemanifest.py
MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py