mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Revert "Do not install CPU-specific libs"
This reverts commit e6b1f1c9f2
.
This commit is contained in:
parent
ef17ae3923
commit
be7c9c2f51
47
build.zig
47
build.zig
@ -339,10 +339,9 @@ pub fn build(b: *std.Build) !void {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const allocator = heap.page_allocator;
|
const allocator = heap.page_allocator;
|
||||||
|
|
||||||
// compile CPU-specific library code
|
|
||||||
for (&mlibs) |*mlib| {
|
for (&mlibs) |*mlib| {
|
||||||
var target2 = target;
|
var target2 = target;
|
||||||
|
|
||||||
for (mlib.arches) |arch| {
|
for (mlib.arches) |arch| {
|
||||||
if (target.result.cpu.arch == arch) {
|
if (target.result.cpu.arch == arch) {
|
||||||
for (mlib.flags) |flag| {
|
for (mlib.flags) |flag| {
|
||||||
@ -372,33 +371,35 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
lib.linkLibrary(elib);
|
lib.linkLibrary(elib);
|
||||||
|
b.installArtifact(elib);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compile generic library code
|
{ // compile generic library code
|
||||||
var walker = try src_dir.walk(allocator);
|
var walker = try src_dir.walk(allocator);
|
||||||
files: while (try walker.next()) |entry| {
|
files: while (try walker.next()) |entry| {
|
||||||
var flags = std.ArrayList([]const u8).init(allocator);
|
var flags = std.ArrayList([]const u8).init(allocator);
|
||||||
defer flags.deinit();
|
defer flags.deinit();
|
||||||
try flags.appendSlice(base_flags);
|
try flags.appendSlice(base_flags);
|
||||||
|
|
||||||
const name = entry.basename;
|
const name = entry.basename;
|
||||||
|
|
||||||
if (mem.endsWith(u8, name, ".c")) {
|
if (mem.endsWith(u8, name, ".c")) {
|
||||||
for (mlibs) |mlib| {
|
for (mlibs) |mlib| {
|
||||||
for (mlib.sources) |path| {
|
for (mlib.sources) |path| {
|
||||||
if (mem.eql(u8, entry.path, path)) continue :files;
|
if (mem.eql(u8, entry.path, path)) continue :files;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
|
||||||
|
|
||||||
|
lib.addCSourceFiles(.{
|
||||||
|
.files = &.{full_path},
|
||||||
|
.flags = flags.items,
|
||||||
|
});
|
||||||
|
} else if (mem.endsWith(u8, name, ".S")) {
|
||||||
|
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
|
||||||
|
lib.addAssemblyFile(.{ .path = full_path });
|
||||||
}
|
}
|
||||||
|
|
||||||
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
|
|
||||||
|
|
||||||
lib.addCSourceFiles(.{
|
|
||||||
.files = &.{full_path},
|
|
||||||
.flags = flags.items,
|
|
||||||
});
|
|
||||||
} else if (mem.endsWith(u8, name, ".S")) {
|
|
||||||
const full_path = try fmt.allocPrint(allocator, "{s}/{s}", .{ src_path, entry.path });
|
|
||||||
lib.addAssemblyFile(.{ .path = full_path });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user