authorgravatar for sentrycraft123@gmail.comJan200101 <sentrycraft123@gmail.com> 2023-04-11 21:05:53+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-12 18:58:47-04:00
log856a9c2e3120d9ffa1166eed13641600230946da
tree7156ac2336d71fda45ba3fdc8e90c20f8e44ab56
parent60bd13bdf2f4834436df8c561b3bc95ec08af34e

build: add option to not build langref on install


2 files changed, 11 insertions(+), 1 deletions(-)

CMakeLists.txt+9
......@@ -81,6 +81,9 @@ message(STATUS "Configuring zig version ${RESOLVED_ZIG_VERSION}")
8181set(ZIG_NO_LIB off CACHE BOOL
8282 "Disable copying lib/ files to install prefix during the build phase")
8383
84set(ZIG_NO_LANGREF off CACHE BOOL
85 "Disable copying of langref to the install prefix during the build phase")
86
8487set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL "Deprecated. Use ZIG_NO_LIB")
8588if(ZIG_SKIP_INSTALL_LIB_FILES)
8689 message(WARNING "ZIG_SKIP_INSTALL_LIB_FILES is deprecated. Use ZIG_NO_LIB instead.")
......@@ -819,6 +822,11 @@ if(ZIG_NO_LIB)
819822else()
820823 set(ZIG_NO_LIB_ARG "")
821824endif()
825if(ZIG_NO_LANGREF)
826 set(ZIG_NO_LANGREF_ARG "-Dno-langref")
827else()
828 set(ZIG_NO_LANGREF_ARG "")
829endif()
822830if(ZIG_SINGLE_THREADED)
823831 set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")
824832else()
......@@ -843,6 +851,7 @@ set(ZIG_BUILD_ARGS
843851 ${ZIG_RELEASE_ARG}
844852 ${ZIG_STATIC_ARG}
845853 ${ZIG_NO_LIB_ARG}
854 ${ZIG_NO_LANGREF_ARG}
846855 ${ZIG_SINGLE_THREADED_ARG}
847856 ${ZIG_PIE_ARG}
848857 "-Dtarget=${ZIG_TARGET_TRIPLE}"
build.zig+2-1
......@@ -36,6 +36,7 @@ pub fn build(b: *std.Build) !void {
3636 std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});
3737 }
3838 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;
39 const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files;
3940
4041 const docgen_exe = b.addExecutable(.{
4142 .name = "docgen",
......@@ -53,7 +54,7 @@ pub fn build(b: *std.Build) !void {
5354 docgen_cmd.addFileSourceArg(.{ .path = "doc/langref.html.in" });
5455 const langref_file = docgen_cmd.addOutputFileArg("langref.html");
5556 const install_langref = b.addInstallFileWithDir(langref_file, .prefix, "doc/langref.html");
56 if (!skip_install_lib_files) {
57 if (!skip_install_langref) {
5758 b.getInstallStep().dependOn(&install_langref.step);
5859 }
5960