Commitede11ee6Recorded24 Apr 2026Repositorysigil-app

v0.8.3: add Windows link flags + windows-amd64 cross-compile config

Message

Add a (windows) branch to the sokolapp link-flags case with the Win32 support libs required by sokolapp.h's MinGW/MSYS2 gcc docs for the GL backend:

  -lkernel32  GetModuleHandleW, LoadLibraryA, GetProcAddress
  -luser32    CreateWindowExW, WM_* message loop
  -lshell32   CommandLineToArgvW, DragQueryFileW, DragFinish
              (sokol_app.h:2458 pragma-comment-lib)
  -lgdi32     ChoosePixelFormat, SetPixelFormat (GL backend only,
              per sokol_app.h line 86)

Opengl32 is intentionally omitted: sokolapp loads opengl32.dll dynamically via LoadLibraryA + GetProcAddress (sokolapp.h:8294), so static linking -lopengl32 would be redundant.

Add a windows-amd64 config (toolchain: 'zig, target: x86_64-windows-gnu) so 'sigil build --config windows-amd64' / '--target windows-amd64' actually cross-compiles. Without a matching config in package.sgl, sigil's default-config fallback silently produces host objects in a misleadingly-named build/windows-amd64/ directory.

Changed
 package.sgl | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
Diff
package.sglmodified
@@ -5,7 +5,7 @@
5
6
(package
7
name: "sigil-app"
8
version: "0.8.2"
+8
version: "0.8.3"
9
description: "Application framework for Sigil (windowing, input, lifecycle)"
10
url: "https://codeberg.org/sigil/sigil-app"
11
license: "BSD-3-Clause"
@@ -21,7 +21,20 @@
21
name: 'release
22
output-dir: "build/release"
23
debug?: #f
24
optimize: 2))
+24
optimize: 2)
+25
+26
;; Windows x86_64 (MinGW via zig) — built so downstream consumers
+27
;; (e.g., cinder-cantata) can produce Windows binaries from Linux.
+28
;; Mirrors the windows-amd64 config in sigil-audio and the main sigil package.
+29
(config
+30
name: 'windows-amd64
+31
output-dir: "build/windows-amd64"
+32
toolchain: 'zig
+33
target: "x86_64-windows-gnu"
+34
static?: #t
+35
debug?: #f
+36
optimize: 2
+37
features: '(release cross windows)))
38
39
dependencies: (list
40
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.0"))
@@ -36,6 +49,7 @@
49
link-flags: (case (host-os)
50
((linux) '("-lX11" "-lXi" "-lXcursor"))
51
((darwin) '("-framework" "Cocoa" "-framework" "QuartzCore"))
+52
((windows) '("-lkernel32" "-luser32" "-lshell32" "-lgdi32"))
53
(else '()))))
54
55
tasks: (list