mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
@cimport is no more
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user