1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

fix: use std.process.getEnvVarOwned instead of std.posix.getenv

This allows cross compiling zap on a windows host
This commit is contained in:
Lord Asdi 2024-05-18 22:07:05 +02:00
parent 70c0ef1100
commit b19f84cc43

View file

@ -13,9 +13,10 @@ pub fn build(b: *std.Build) !void {
const use_openssl = b.option(bool, "openssl", "Use system-installed openssl for TLS support in zap") orelse blk: {
// Alternatively, use an os env var to determine whether to build openssl support
if (std.posix.getenv("ZAP_USE_OPENSSL")) |val| {
if (std.process.getEnvVarOwned(b.allocator, "ZAP_USE_OPENSSL")) |val| {
defer b.allocator.free(val);
if (std.mem.eql(u8, val, "true")) break :blk true;
}
} else |_| {}
break :blk false;
};