Skip to content

Commit 0360628

Browse files
committed
make -Dno-lib also skip docgen
1 parent a965e47 commit 0360628

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ pub fn build(b: *std.Build) !void {
3131
const use_zig_libcxx = b.option(bool, "use-zig-libcxx", "If libc++ is needed, use zig's bundled version, don't try to integrate with the system") orelse false;
3232

3333
const test_step = b.step("test", "Run all the tests");
34+
const deprecated_skip_install_lib_files = b.option(bool, "skip-install-lib-files", "deprecated. see no-lib") orelse false;
35+
if (deprecated_skip_install_lib_files) {
36+
std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});
37+
}
38+
const skip_install_lib_files = b.option(bool, "no-lib", "skip copying of lib/ files and langref to installation prefix. Useful for development") orelse deprecated_skip_install_lib_files;
3439

3540
const docgen_exe = b.addExecutable(.{
3641
.name = "docgen",
@@ -45,7 +50,9 @@ pub fn build(b: *std.Build) !void {
4550
docgen_cmd.addFileSourceArg(.{ .path = "doc/langref.html.in" });
4651
const langref_file = docgen_cmd.addOutputFileArg("langref.html");
4752
const install_langref = b.addInstallFileWithDir(langref_file, .prefix, "langref.html");
48-
b.getInstallStep().dependOn(&install_langref.step);
53+
if (!skip_install_lib_files) {
54+
b.getInstallStep().dependOn(&install_langref.step);
55+
}
4956

5057
const docs_step = b.step("docs", "Build documentation");
5158
docs_step.dependOn(&docgen_cmd.step);
@@ -76,11 +83,6 @@ pub fn build(b: *std.Build) !void {
7683
const skip_stage1 = b.option(bool, "skip-stage1", "Main test suite skips stage1 compile error tests") orelse false;
7784
const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;
7885
const skip_stage2_tests = b.option(bool, "skip-stage2-tests", "Main test suite skips self-hosted compiler tests") orelse false;
79-
const deprecated_skip_install_lib_files = b.option(bool, "skip-install-lib-files", "deprecated. see no-lib") orelse false;
80-
if (deprecated_skip_install_lib_files) {
81-
std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});
82-
}
83-
const skip_install_lib_files = b.option(bool, "no-lib", "skip copying of lib/ files to installation prefix. Useful for development") orelse deprecated_skip_install_lib_files;
8486

8587
const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;
8688

0 commit comments

Comments
 (0)