-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Way to set shared library filename #2231
Comments
I also need this feature. |
It would have been great if the core linux devs would have defined some proper rules for this but sadly it's the wild west. In CLang you just specify the target name, HERE is the real challenge. I happen to be building a project with SQLite extensions. In particular there is note about loading dyn libs:
This suggests to me that they are expecting the file to be absent of the version number. Hence the symlink. |
I think they are saying the file will have the platform-specific extension, and the |
This is now possible with |
For what it's worth, I worked around this for my use-case of a PAM module with a custom build step in this commit: ifreund/rundird@a2e13ba |
I was doing: const lib = b.addSharedLibrary(.{
.name = addon,
.root_source_file = .{ .path = "src/lib/binding/node.zig" },
.optimize = optimize,
.target = target,
});
lib.emit_bin = .{ .emit_to = "build/lib/addon.node" };
b.getInstallStep().dependOn(&lib.step); and this previously "worked"1, though no longer works after #14647 (by running with Details
Footnotes
|
Actually, you can do this already in zig 0.10.1: const plugin_install = b.addInstallFileWithDir(plugin.getOutputSource(), .lib, "plugin.so");
plugin_install.step.dependOn(&plugin.step);
b.getInstallStep().dependOn(&plugin_install.step); |
When creating a shared library for use as a plugin in existing programs/languages, you often need to follow certain naming conventions, e.g.
myprogram-plugin-b.so
.I can't seem to find a way to set the output filename from
zig build-lib -dynamic
. It seems to come out aslibNAME.so.x.y.z
where NAME can be set with--name
andx
/y
/z
can come from the--ver
flags.Possibly related to #2230
The text was updated successfully, but these errors were encountered: