@@ -3,6 +3,7 @@ const std = @import("std");
33pub 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