Create hello-platform for Windows #10

Open
kornerr wants to merge 46 commits from hrbmac into master
pull from: hrbmac
5 changed files with 24 additions and 1 deletions
Showing only changes of commit 48944131a2 - Show all commits

No files matched your search

+15
View File
@@ -241,3 +241,18 @@ util/run-windows
The build uses the existing generated Swift dialect, like the Linux build. The build uses the existing generated Swift dialect, like the Linux build.
The run script locates the existing debug executable without rebuilding it. 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" echo -e "\n> > > > Step №$STEP. Build '$TARGET' for Windows"
cd "$SDIR/../ver-windows" cd "$SDIR/../ver-windows"
export APP_RES_DIR="$SDIR/../ver-windows/res"
swift build swift build
@@ -1,6 +1,9 @@
// swift-tools-version: 5.10 // swift-tools-version: 5.10
import Foundation
import PackageDescription import PackageDescription
let resDir = ProcessInfo.processInfo.environment["APP_RES_DIR"]!
let package = Package( let package = Package(
name: "hello-platform", name: "hello-platform",
dependencies: [ dependencies: [
@@ -13,7 +16,10 @@ let package = Package(
.product(name: "SwiftCrossUI", package: "swift-cross-ui"), .product(name: "SwiftCrossUI", package: "swift-cross-ui"),
.product(name: "WinUIBackend", package: "swift-cross-ui") .product(name: "WinUIBackend", package: "swift-cross-ui")
], ],
path: "src" path: "src",
linkerSettings: [
.unsafeFlags(["-Xlinker", "\(resDir)/AppIcon.res"])
]
) )
] ]
) )
+1
View File
@@ -0,0 +1 @@
../../../../res/AppIcon.res
BIN
View File
Binary file not shown.