Skip to content

Conversation

@Interrupt
Copy link
Contributor

@Interrupt Interrupt commented Jan 14, 2026

When building for targets that need to add additional system headers (like Emscripten, to give Lua access to the Emscripten libC headers) the addTranslateC step does not get those headers that have been supplied by the parent build. This allows users of the library to pass an additional path of headers to include in that step.

Example usage from one of my tests:

pub fn getEmsdkSystemIncludePath(dep_sokol: *Build.Dependency) Build.LazyPath {
    const dep_emsdk = dep_sokol.builder.dependency("emsdk", .{});
    return dep_emsdk.path("upstream/emscripten/cache/sysroot/include");
}

...

const dep_zlua = b.dependency("zlua", .{
    .target = target,
    .optimize = optimize,
    .lang = .lua54,
    .additional_system_headers = getEmsdkSystemIncludePath(dep_sokol).getPath(b),
});

@robbielyman robbielyman merged commit 66b69d8 into natecraddock:main Jan 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants