Skip to content

Commit

Permalink
Merge branch 'zig-0.12.0' into zig-0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai authored Apr 21, 2024
2 parents 44af238 + 0156c61 commit 8cfd190
Show file tree
Hide file tree
Showing 39 changed files with 91 additions and 24,653 deletions.
13 changes: 10 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ pub fn build(b: *std.Build) !void {
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const optimize = b.standardOptimizeOption(.{});

const use_openssl = b.option(bool, "openssl", "Use system-installed openssl for TLS support in zap") orelse false;

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.mem.eql(u8, val, "true")) break :blk true;
}
break :blk false;
};

// create a module to be used internally.
const zap_module = b.addModule("zap", .{
Expand All @@ -27,14 +34,14 @@ pub fn build(b: *std.Build) !void {

// -- Docs
const docs_obj = b.addObject(.{
.name = "docs",
.name = "zap", // name doesn't seem to matter
.root_source_file = .{ .path = "src/zap.zig" },
.target = target,
.optimize = .Debug,
});
const install_docs = b.addInstallDirectory(.{
.install_dir = .prefix,
.install_subdir = "docs",
.install_subdir = "zap", // will also be the main namespace in the docs
.source_dir = docs_obj.getEmittedDocs(),
});
b.step("docs", "Build docs").dependOn(&install_docs.step);
Expand Down
Loading

0 comments on commit 8cfd190

Please sign in to comment.