Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MinGW-w64's WinRT headers in zig cc #23115

Open
silbinarywolf opened this issue Mar 6, 2025 · 2 comments
Open

Support MinGW-w64's WinRT headers in zig cc #23115

silbinarywolf opened this issue Mar 6, 2025 · 2 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Milestone

Comments

@silbinarywolf
Copy link
Contributor

silbinarywolf commented Mar 6, 2025

Zig Version

0.14.0

Steps to Reproduce and Observed Behavior

Not sure if the removal of the following headers was intentional but it breaks compilation of SDL3. The current workaround is to simply include the following files by other means if you want to build for Windows.

Main include missing:
{zig-0.13.0}\lib\libc\include\any-windows-any\windows.gaming.input.h

Dependencies of above include:
windows.devices.haptics.h
windows.devices.power.h
windows.foundation.collections.h
windows.foundation.h
windows.foundation.numerics.h
windows.gaming.input.forcefeedback.h
windows.system.h
windows.system.power.h
windowscontracts.h
eventtoken.h
ivectorchangedeventargs.h

Zip of above files if you want to quickly / easily fix your SDL3 build
any-windows-any-from-zig-0.13.0.zip

Files are also used in my own project here:
https://github.com/silbinarywolf/desk-breaker/tree/4f47bd9faa2d3eb4e5fb69fd4a4a2fef82284e33/third-party/sdl/upstream/any-windows-any

Expected Behavior

That these files would not be removed from lib\libc\include\any-windows-any between Zig 0.13.0 and Zig 0.14.0

@silbinarywolf silbinarywolf added the bug Observed behavior contradicts documented or intended behavior label Mar 6, 2025
@castholm
Copy link
Contributor

castholm commented Mar 6, 2025

Arguably not a bug and rather an intentional change to reduce the installation size, see #22156 and the discussion near the bottom of it. Note that WGI is an optional dependency of SDL3 only required for compatibility with some Xbox controller features and that SDL3 is perfectly buildable without it.

@alexrp
Copy link
Member

alexrp commented Mar 6, 2025

I think what we could do is provide MinGW-w64's WinRT headers as a Zig package that an SDL Zig package could take an optional dependency on. Alternatively, once #16270 happens and zig cc itself becomes a separate package, shipping WinRT headers with it might be more acceptable since it won't impact the main Zig distribution. The latter approach would of course be preferable for the zig cc-without-Zig-build-system use case.

@alexrp alexrp added enhancement Solving this issue will likely involve adding new logic or components to the codebase. and removed bug Observed behavior contradicts documented or intended behavior labels Mar 6, 2025
@alexrp alexrp changed the title SDL3 no longer compiles on Windows due to missing "windows.gaming.input.h" (Zig 0.13.0 -> Zig 0.14.0) Support MinGW-w64's WinRT headers in zig cc Mar 6, 2025
@alexrp alexrp added this to the 0.16.0 milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-windows
Projects
None yet
Development

No branches or pull requests

3 participants