@cimport is no more

This commit is contained in:
Frank Denis
2026-05-02 14:20:50 +02:00
parent f1f5745f50
commit 10f787b53f
14 changed files with 23 additions and 13 deletions
+10
View File
@@ -362,6 +362,15 @@ pub fn build(b: *std.Build) !void {
tv_options.addOption(bool, "offline", offline);
tv_options.addOption([]const u8, "cache_dir", "test/vectors/cache");
const translate_c = b.addTranslateC(.{
.root_source_file = b.path("src/libsodium/include/sodium.h"),
.target = target,
.optimize = optimize,
.link_libc = true,
});
translate_c.addIncludePath(b.path("src/libsodium/include"));
const c_mod = translate_c.createModule();
const tv_mod = b.createModule(.{
.root_source_file = b.path("test/vectors/main.zig"),
.target = target,
@@ -371,6 +380,7 @@ pub fn build(b: *std.Build) !void {
tv_mod.linkLibrary(static_lib);
tv_mod.addIncludePath(b.path("src/libsodium/include"));
tv_mod.addOptions("build_options", tv_options);
tv_mod.addImport("c", c_mod);
const tv_exe = b.addExecutable(.{
.name = "test-vectors",
+1 -1
View File
@@ -18,7 +18,7 @@ const kdf = @import("suites/kdf.zig");
const pwhash = @import("suites/pwhash.zig");
const xof = @import("suites/xof.zig");
const kem = @import("suites/kem.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -1,7 +1,7 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -1,7 +1,7 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -1,7 +1,7 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -1,7 +1,7 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;
+1 -1
View File
@@ -2,7 +2,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;
const parse = @import("../parse.zig");
const fetch = @import("../fetch.zig");
const c = @cImport(@cInclude("sodium.h"));
const c = @import("c");
const Result = parse.Result;