Skip to content

Windows build fails on Zig 0.17.0-dev.667+0569f1f6a due to unused config header values #22

@kenjpirkle

Description

@kenjpirkle

Summary

On Windows, building this package with newer Zig master fails during SDL_build_config.h generation because the Windows config helper provides several values that are not present in upstream SDL 3.4.4's SDL_build_config.h.cmake.

This appears to be exposed by newer Zig versions being stricter about unused addConfigHeader values.

Platform

Windows x86_64

Zig versions tested

Works:

0.16.0
0.17.0-dev.101+4e2147d14

Fails:

0.17.0-dev.667+0569f1f6a
0.17.0-dev.263+0add2dfc4

Error

            └─ compile lib SDL3 Debug native
               └─ configure cmake header dependency to SDL_build_config.h failure
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_D3D11_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_AUDIOCLIENT_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_SENSORSAPI_H

The Windows config code in this package appears to provide them to b.addConfigHeader, and removing the three entries locally allows the build to get past config-header generation:

.HAVE_D3D11_H = true,
.HAVE_AUDIOCLIENT_H = true,
.HAVE_SENSORSAPI_H = true,

Expected behaviour

The package should build without unused config-header values when used with newer Zig versions.

Question

Are these three HAVE_* values stale for SDL 3.4.4 and safe to remove, or should they be replaced with newer SDL config names?

Additional context

After removing those entries, build still fails later in translate-c, involving missing builtins (44 missing in total) such as:

__builtin_elementwise_fshr
__builtin_elementwise_fshl

I'm almost certain these are due to the upgrade to LLVM 22 or translate-c/arocc related (a couple of issues regarding missing builtins exist and/or have been fixed in translate-c)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions