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}")...@@ -81,6 +81,9 @@ message(STATUS "Configuring zig version ${RESOLVED_ZIG_VERSION}")
81set(ZIG_NO_LIB off CACHE BOOL81set(ZIG_NO_LIB off CACHE BOOL
82 "Disable copying lib/ files to install prefix during the build phase")82 "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
84set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL "Deprecated. Use ZIG_NO_LIB")87set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL "Deprecated. Use ZIG_NO_LIB")
85if(ZIG_SKIP_INSTALL_LIB_FILES)88if(ZIG_SKIP_INSTALL_LIB_FILES)
86 message(WARNING "ZIG_SKIP_INSTALL_LIB_FILES is deprecated. Use ZIG_NO_LIB instead.")89 message(WARNING "ZIG_SKIP_INSTALL_LIB_FILES is deprecated. Use ZIG_NO_LIB instead.")
...@@ -819,6 +822,11 @@ if(ZIG_NO_LIB)...@@ -819,6 +822,11 @@ if(ZIG_NO_LIB)
819else()822else()
820 set(ZIG_NO_LIB_ARG "")823 set(ZIG_NO_LIB_ARG "")
821endif()824endif()
825if(ZIG_NO_LANGREF)
826 set(ZIG_NO_LANGREF_ARG "-Dno-langref")
827else()
828 set(ZIG_NO_LANGREF_ARG "")
829endif()
822if(ZIG_SINGLE_THREADED)830if(ZIG_SINGLE_THREADED)
823 set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")831 set(ZIG_SINGLE_THREADED_ARG "-fsingle-threaded")
824else()832else()
...@@ -843,6 +851,7 @@ set(ZIG_BUILD_ARGS...@@ -843,6 +851,7 @@ set(ZIG_BUILD_ARGS
843 ${ZIG_RELEASE_ARG}851 ${ZIG_RELEASE_ARG}
844 ${ZIG_STATIC_ARG}852 ${ZIG_STATIC_ARG}
845 ${ZIG_NO_LIB_ARG}853 ${ZIG_NO_LIB_ARG}
854 ${ZIG_NO_LANGREF_ARG}
846 ${ZIG_SINGLE_THREADED_ARG}855 ${ZIG_SINGLE_THREADED_ARG}
847 ${ZIG_PIE_ARG}856 ${ZIG_PIE_ARG}
848 "-Dtarget=${ZIG_TARGET_TRIPLE}"857 "-Dtarget=${ZIG_TARGET_TRIPLE}"
build.zig+2-1
...@@ -36,6 +36,7 @@ pub fn build(b: *std.Build) !void {...@@ -36,6 +36,7 @@ pub fn build(b: *std.Build) !void {
36 std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});36 std.log.warn("-Dskip-install-lib-files is deprecated in favor of -Dno-lib", .{});
37 }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;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;
39 const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files;
3940
40 const docgen_exe = b.addExecutable(.{41 const docgen_exe = b.addExecutable(.{
41 .name = "docgen",42 .name = "docgen",
...@@ -53,7 +54,7 @@ pub fn build(b: *std.Build) !void {...@@ -53,7 +54,7 @@ pub fn build(b: *std.Build) !void {
53 docgen_cmd.addFileSourceArg(.{ .path = "doc/langref.html.in" });54 docgen_cmd.addFileSourceArg(.{ .path = "doc/langref.html.in" });
54 const langref_file = docgen_cmd.addOutputFileArg("langref.html");55 const langref_file = docgen_cmd.addOutputFileArg("langref.html");
55 const install_langref = b.addInstallFileWithDir(langref_file, .prefix, "doc/langref.html");56 const install_langref = b.addInstallFileWithDir(langref_file, .prefix, "doc/langref.html");
56 if (!skip_install_lib_files) {57 if (!skip_install_langref) {
57 b.getInstallStep().dependOn(&install_langref.step);58 b.getInstallStep().dependOn(&install_langref.step);
58 }59 }
5960