Try building a Windows manifest.

This commit is contained in:
David Given
2023-10-27 21:38:44 +02:00
parent 5af0b68e06
commit 0dbce00fe4
5 changed files with 48 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ ifeq ($(OS), Windows_NT)
PKG_CONFIG = $(MINGWBIN)/pkg-config
WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes
PROTOC = $(MINGWBIN)/protoc
WINDRES = windres
LDFLAGS += \
-static
CXXFLAGS += \

View File

@@ -32,3 +32,13 @@ normalrule(
commands=["iconutil -c icns -o {outs[0]} {ins[0]}"],
label="ICONUTIL",
)
normalrule(
name="fluxengine_ico",
ins=["./icon.png"],
outs=["fluxengine.ico"],
commands=[
"convert {ins[0]} -resize 64x46 -define icon:auto-resize=64,48,32,16 {outs[0]}"
],
label="MAKEICON",
)

View File

@@ -14,6 +14,19 @@ WX_LDFLAGS := $(shell $(WX_CONFIG) --libs core base adv aui richtext)
"""
)
extrasrcs = []
if config.windows:
extrasrcs += [
normalrule(
name="rc",
ins=["./windres.rc"],
outs=["rc.o"],
deps=["./manifest.xml", "extras+fluxengine_ico"],
commands=["$(WINDRES) {ins[0]} {outs[0]}"],
label="WINDRES",
)
]
cxxprogram(
name="gui",
srcs=[
@@ -35,7 +48,8 @@ cxxprogram(
"./textviewerwindow.cc",
"./visualisationcontrol.cc",
"./layout.cpp",
],
]
+ extrasrcs,
cflags=["$(WX_CFLAGS)"],
ldflags=["$(WX_LDFLAGS)"],
deps=[

13
src/gui/manifest.xml Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>FluxEngine</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

9
src/gui/windres.rc Normal file
View File

@@ -0,0 +1,9 @@
/* © 2023 David Given.
* FluxEngine is licensed under the MIT open source license. See the COPYING
* file in this distribution for the full text.
*/
#include "winuser.h"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "src/gui/manifest.xml"
101 ICON DISCARDABLE ".obj/extras+fluxengine_ico/fluxengine.ico"