build: update for zig-0.12.0 release

Minor fixes for the header installation.
This commit is contained in:
torque 2024-05-12 13:54:22 -07:00
parent 9f74aeb1d2
commit 0199ffa55a
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -58,12 +58,12 @@ const LibreSslLibs = struct {
}
if (std.mem.endsWith(u8, child.basename, ".h")) {
const full = try std.mem.concat(b.allocator, u8, &.{ base, child.path });
defer b.allocator.free(full);
const full = try std.fs.path.join(b.allocator, &.{ base, child.path });
self.libcrypto.installHeader(full, child.path);
self.libssl.installHeader(full, child.path);
self.libtls.installHeader(full, child.path);
const path = b.path(full);
self.libcrypto.installHeader(path, child.path);
self.libssl.installHeader(path, child.path);
self.libtls.installHeader(path, child.path);
}
}
}
@ -229,18 +229,19 @@ pub fn libresslBuild(
else => @panic("unsupported target OS"),
}
const conf_header = switch (tinfo.cpu.arch) {
const conf_header = b.path(switch (tinfo.cpu.arch) {
.aarch64, .aarch64_be, .aarch64_32 => source_header_prefix ++ "arch/aarch64/opensslconf.h",
.x86 => source_header_prefix ++ "arch/i386/opensslconf.h",
.riscv64 => source_header_prefix ++ "arch/riscv64/opensslconf.h",
.x86_64 => source_header_prefix ++ "arch/amd64/opensslconf.h",
else => @panic("unsupported target CPU arch"),
};
});
libressl_libs.libcrypto.installHeader(conf_header, "openssl/opensslconf.h");
libressl_libs.libssl.installHeader(conf_header, "openssl/opensslconf.h");
libressl_libs.libtls.installHeader(conf_header, "openssl/opensslconf.h");
const install_conf = b.addInstallHeaderFile(conf_header, "openssl/opensslconf.h");
libressl_libs.libcrypto.step.dependOn(&install_conf.step);
libressl_libs.libssl.step.dependOn(&install_conf.step);
libressl_libs.libtls.step.dependOn(&install_conf.step);
try libressl_libs.header_search(
b,