mirror of
https://github.com/jedisct1/minisign.git
synced 2025-04-03 19:07:41 +03:00
Add -Dstatic
This commit is contained in:
parent
12333fd7d1
commit
e0e86b4e4f
2 changed files with 11 additions and 3 deletions
|
@ -5,6 +5,7 @@ pub fn build(b: *std.Build) !void {
|
|||
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSmall });
|
||||
|
||||
const use_libzodium = b.option(bool, "without_libsodium", "Use the zig standard library instead of libsodium") orelse false;
|
||||
const use_static_linking = b.option(bool, "static", "Statically link the binary") orelse false;
|
||||
|
||||
const minisign = b.addExecutable(.{
|
||||
.name = "minisign",
|
||||
|
@ -31,7 +32,10 @@ pub fn build(b: *std.Build) !void {
|
|||
} else {
|
||||
minisign.root_module.linkSystemLibrary(
|
||||
"sodium",
|
||||
.{ .use_pkg_config = .yes },
|
||||
.{
|
||||
.use_pkg_config = .yes,
|
||||
.preferred_link_mode = if (use_static_linking) .static else .dynamic,
|
||||
},
|
||||
);
|
||||
}
|
||||
minisign.addIncludePath(b.path("src"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue