-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
In addition to using the @import("ziglua")
module from zig code, I need to compile additional C extensions which depend on the headers for the correct lua version as exposed by ziglua
.
After some trial and error I found this to work:
my_module.addImport("ziglua", ziglua.module("ziglua"));
// addImport already links by itself. but we need headers as well..
my_module.linkLibrary(ziglua.artifact("lua"));
This feels a bit hacky as it relies on the artifact name "lua"
which might be seen as internal to ziglua (not part of the exported module), and also, as addImport by itself is enough to add the .o files for the lua library, linkLibrary
would add the same objects a second time?
This should "safely" be handled gracefully by most linkers, but it would be best to avoid this if possible.
Any thoughts about what the proper way would be?
Metadata
Metadata
Assignees
Labels
No labels