Skip to content

Commit 63fa674

Browse files
committed
fix: fixed build issues on ubuntu
1 parent 21dda88 commit 63fa674

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ jobs:
7272
version: 0.14.1
7373

7474
- name: Build library
75-
run: zig build-lib src/root.zig --name hash_zig
75+
run: zig build

build.zig

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const std = @import("std");
33
pub fn build(b: *std.Build) void {
44
const target = b.standardTargetOptions(.{});
55
const optimize = b.standardOptimizeOption(.{});
6+
const enable_docs = b.option(bool, "docs", "Enable docs generation") orelse false;
67

78
// Create the module
89
const hash_zig_module = b.addModule("hash-zig", .{
@@ -166,12 +167,14 @@ pub fn build(b: *std.Build) void {
166167
// const optimized_benchmark_step = b.step("optimized-benchmark", "Run optimized performance benchmark");
167168
// optimized_benchmark_step.dependOn(&run_optimized_benchmark.step);
168169

169-
// Documentation
170-
const docs_step = b.step("docs", "Generate documentation");
171-
const install_docs = b.addInstallDirectory(.{
172-
.source_dir = lib.getEmittedDocs(),
173-
.install_dir = .prefix,
174-
.install_subdir = "docs",
175-
});
176-
docs_step.dependOn(&install_docs.step);
170+
// Documentation (opt-in to avoid enabling -femit-docs on default builds)
171+
if (enable_docs) {
172+
const docs_step = b.step("docs", "Generate documentation");
173+
const install_docs = b.addInstallDirectory(.{
174+
.source_dir = lib.getEmittedDocs(),
175+
.install_dir = .prefix,
176+
.install_subdir = "docs",
177+
});
178+
docs_step.dependOn(&install_docs.step);
179+
}
177180
}

0 commit comments

Comments
 (0)