v0.9.2: add Windows link-flags branch + windows-amd64 cross-compile config
sokolgfx + sokolgp with SOKOLGLCORE on Windows MinGW need no extra link libs beyond what sigil-app supplies: the embedded Win32 GL loader (SOKOLUSEWIN32GLLOADER at sokolgfx.h:5556) pulls opengl32.dll dynamically via LoadLibraryA + wglGetProcAddress (sokolgfx.h:9131), and the only system import it needs is GetProcAddress from kernel32, which sigil-app already links. sokol_gfx.h's own MinGW/MSYS2 link docs confirm this explicitly (only -ld3d11 is needed extra, and only for the D3D11 backend).
Add an explicit (windows) '() branch with a comment documenting the reasoning, so a future reader doesn't "helpfully" add -lopengl32.
Add a windows-amd64 config (toolchain: 'zig, target: x86_64-windows-gnu) to match sigil-app v0.8.3. Without this, 'sigil build --config windows-amd64' silently cross-compiles for the host — the .a archive contains Linux ELF objects in a directory named windows-amd64/.
package.sgl | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)package.sglmodified
(package name: "sigil-graphics" version: "0.9.1" version: "0.9.2" description: "2D graphics, image loading, and font rendering for Sigil" url: "https://codeberg.org/sigil/sigil-graphics" license: "BSD-3-Clause" name: 'release output-dir: "build/release" debug?: #f optimize: 2)) optimize: 2) ;; Windows x86_64 (MinGW via zig) — built so downstream consumers ;; (e.g., cinder-cantata) can produce Windows binaries from Linux. ;; Mirrors the windows-amd64 config in sigil-audio and the main sigil package. (config name: 'windows-amd64 output-dir: "build/windows-amd64" toolchain: 'zig target: "x86_64-windows-gnu" static?: #t debug?: #f optimize: 2 features: '(release cross windows))) dependencies: (list (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.0") "src/c/graphics.c" "src/c/image.c" "src/c/font.c") c-include-dirs: '("vendor/sokol" "vendor/stb") native-init: "sigil__init_sigil_graphics_module" ;; Platform-specific linker flags for OpenGL ;; Platform-specific linker flags for OpenGL. ;; Windows: sokol_gfx's GL backend loads opengl32.dll dynamically via ;; LoadLibraryA + GetProcAddress (kernel32 — linked via sigil-app), so no ;; extra link libs are needed beyond what sigil-app provides. link-flags: (case (host-os) ((linux) '("-lGL")) ((darwin) '("-framework" "OpenGL" "-framework" "Metal" "-framework" "MetalKit")) ((windows) '()) (else '())))) tasks: (list