1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 10:05:05 -07:00

Update for Zig-master

This commit is contained in:
Frank Denis 2023-10-16 18:07:55 +02:00
parent ffd1e37498
commit 9ff9301465

View File

@ -247,12 +247,15 @@ pub fn build(b: *std.build.Builder) !void {
const name = entry.basename;
if (mem.endsWith(u8, name, ".c")) {
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
lib.addCSourceFiles(&.{full_path}, &.{
"-fvisibility=hidden",
"-fno-strict-aliasing",
"-fno-strict-overflow",
"-fwrapv",
"-flax-vector-conversions",
lib.addCSourceFiles(.{
.files = &.{full_path},
.flags = &.{
"-fvisibility=hidden",
"-fno-strict-aliasing",
"-fno-strict-overflow",
"-fwrapv",
"-flax-vector-conversions",
},
});
} else if (mem.endsWith(u8, name, ".S")) {
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
@ -291,7 +294,7 @@ pub fn build(b: *std.build.Builder) !void {
exe.addIncludePath(.{ .path = "src/libsodium/include" });
exe.addIncludePath(.{ .path = "test/quirks" });
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ test_path, entry.path });
exe.addCSourceFiles(&.{full_path}, &.{});
exe.addCSourceFiles(.{ .files = &.{full_path} });
if (enable_benchmarks) {
exe.defineCMacro("BENCHMARKS", "1");