mirror of
https://github.com/jedisct1/minisign.git
synced 2025-04-04 19:37:48 +03:00
Update for Zig 0.11
This commit is contained in:
parent
709fed6b73
commit
8aef018182
2 changed files with 15 additions and 12 deletions
|
@ -24,7 +24,7 @@ Dependencies:
|
||||||
|
|
||||||
Compilation:
|
Compilation:
|
||||||
|
|
||||||
$ zig build -Drelease-safe
|
$ zig build -Drelease
|
||||||
|
|
||||||
## Using cmake and gcc or clang:
|
## Using cmake and gcc or clang:
|
||||||
|
|
||||||
|
|
25
build.zig
25
build.zig
|
@ -1,21 +1,24 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) !void {
|
pub fn build(b: *std.build.Builder) !void {
|
||||||
var target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const mode = b.standardReleaseOptions();
|
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSmall });
|
||||||
|
|
||||||
const minisign = b.addExecutable("minisign", null);
|
const minisign = b.addExecutable(.{
|
||||||
minisign.setTarget(target);
|
.name = "minisign",
|
||||||
minisign.setBuildMode(mode);
|
.target = target,
|
||||||
minisign.install();
|
.optimize = optimize,
|
||||||
|
});
|
||||||
minisign.linkLibC();
|
minisign.linkLibC();
|
||||||
minisign.addLibraryPath("/opt/homebrew/lib");
|
minisign.addLibraryPath(.{ .path = "/opt/homebrew/lib" });
|
||||||
minisign.addLibraryPath("/usr/local/lib");
|
minisign.addLibraryPath(.{ .path = "/usr/local/lib" });
|
||||||
minisign.linkSystemLibrary("sodium");
|
minisign.linkSystemLibrary("sodium");
|
||||||
|
|
||||||
minisign.addIncludePath("src");
|
minisign.addIncludePath(.{ .path = "src" });
|
||||||
minisign.addSystemIncludePath("/opt/homebrew/include");
|
minisign.addSystemIncludePath(.{ .path = "/opt/homebrew/include" });
|
||||||
minisign.addSystemIncludePath("/usr/local/include");
|
minisign.addSystemIncludePath(.{ .path = "/usr/local/include" });
|
||||||
minisign.defineCMacro("_GNU_SOURCE", "1");
|
minisign.defineCMacro("_GNU_SOURCE", "1");
|
||||||
minisign.addCSourceFiles(&.{ "src/base64.c", "src/get_line.c", "src/helpers.c", "src/minisign.c" }, &.{});
|
minisign.addCSourceFiles(&.{ "src/base64.c", "src/get_line.c", "src/helpers.c", "src/minisign.c" }, &.{});
|
||||||
|
|
||||||
|
b.installArtifact(minisign);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue