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:
@@ -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 $@
|
||||
|
||||
@@ -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`.
|
||||
|
||||
1
ports/windows/micropython.rc
Normal file
1
ports/windows/micropython.rc
Normal file
@@ -0,0 +1 @@
|
||||
app ICON "../../logo/vector-logo-2.ico"
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user