authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-16 18:58:27-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-16 18:58:27-07:00
logdd5a1b1106b3aed3aacd54e9615d96703d29ed9d
tree373bb02788a558180be13e76547149f35206cb61
parent9375ad0d3b5e97fa2889622862dbc4724b9e9243

build.zig: add a way to skip installing lib/ files


1 files changed, 16 insertions(+), 13 deletions(-)

build.zig+16-13
......@@ -53,6 +53,7 @@ pub fn build(b: *Builder) !void {
5353 const skip_compile_errors = b.option(bool, "skip-compile-errors", "Main test suite skips compile error tests") orelse false;
5454 const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;
5555 const skip_stage2_tests = b.option(bool, "skip-stage2-tests", "Main test suite skips self-hosted compiler tests") orelse false;
56 const skip_install_lib_files = b.option(bool, "skip-install-lib-files", "Do not copy lib/ files to installation prefix") orelse false;
5657
5758 const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;
5859 const is_stage1 = b.option(bool, "stage1", "Build the stage1 compiler, put stage2 behind a feature flag") orelse false;
......@@ -61,19 +62,21 @@ pub fn build(b: *Builder) !void {
6162 const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm);
6263 const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
6364
64 b.installDirectory(InstallDirectoryOptions{
65 .source_dir = "lib",
66 .install_dir = .Lib,
67 .install_subdir = "zig",
68 .exclude_extensions = &[_][]const u8{
69 "test.zig",
70 "README.md",
71 ".z.0",
72 ".z.9",
73 ".gz",
74 "rfc1951.txt",
75 },
76 });
65 if (!skip_install_lib_files) {
66 b.installDirectory(InstallDirectoryOptions{
67 .source_dir = "lib",
68 .install_dir = .Lib,
69 .install_subdir = "zig",
70 .exclude_extensions = &[_][]const u8{
71 "test.zig",
72 "README.md",
73 ".z.0",
74 ".z.9",
75 ".gz",
76 "rfc1951.txt",
77 },
78 });
79 }
7780
7881 if (only_install_lib_files)
7982 return;