try icon
This commit is contained in:
1 parent
6cdc309b9c
commit
48944131a2
5 files changed
+24
-1
No files matched your search
@@ -241,3 +241,18 @@ util/run-windows
|
||||
|
||||
The build uses the existing generated Swift dialect, like the Linux build.
|
||||
The run script locates the existing debug executable without rebuilding it.
|
||||
|
||||
### Windows executable icon
|
||||
|
||||
`res/AppIcon.res` is a ready-made Windows resource containing six icon sizes
|
||||
(16–256px) from the shared `res/AppIcon.png`, with icon group ID 101.
|
||||
`ver-windows/res/AppIcon.res` links to it. No ICO or RC file is required by the
|
||||
Windows target, and the build does not compile resources.
|
||||
|
||||
`step/buildWindows` exports `APP_RES_DIR` as the absolute Git Bash
|
||||
`ver-windows/res` path derived from `$SDIR/../ver-windows/res`.
|
||||
The entry script obtains `SDIR` with `pwd -P`;
|
||||
no resource copy is needed. The manifest appends `/AppIcon.res` and passes it to the linker.
|
||||
Manual SwiftPM commands that evaluate the manifest also need `APP_RES_DIR`.
|
||||
Windows compilation and the live window/taskbar icon require verification on
|
||||
Windows; no Windows build was performed when this wiring was added.
|
||||
@@ -5,4 +5,5 @@ STEP=$((STEP+1))
|
||||
echo -e "\n> > > > Step №$STEP. Build '$TARGET' for Windows"
|
||||
|
||||
cd "$SDIR/../ver-windows"
|
||||
export APP_RES_DIR="$SDIR/../ver-windows/res"
|
||||
swift build
|
||||
@@ -1,6 +1,9 @@
|
||||
// swift-tools-version: 5.10
|
||||
import Foundation
|
||||
import PackageDescription
|
||||
|
||||
let resDir = ProcessInfo.processInfo.environment["APP_RES_DIR"]!
|
||||
|
||||
let package = Package(
|
||||
name: "hello-platform",
|
||||
dependencies: [
|
||||
@@ -13,7 +16,10 @@ let package = Package(
|
||||
.product(name: "SwiftCrossUI", package: "swift-cross-ui"),
|
||||
.product(name: "WinUIBackend", package: "swift-cross-ui")
|
||||
],
|
||||
path: "src"
|
||||
path: "src",
|
||||
linkerSettings: [
|
||||
.unsafeFlags(["-Xlinker", "\(resDir)/AppIcon.res"])
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
../../../../res/AppIcon.res
|
||||
Binary file not shown.
Reference in new issue
Block a user