authorgravatar for fer.obbee@gmail.comRuslan Prokopchuk <fer.obbee@gmail.com> 2019-04-04 09:21:55+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-03 18:31:25-04:00
log70ae3222b54c05fc88e9c94a1ae12ead07fa4341
tree63ef60e5b3e65485544e0a6536d0baa157059be3
parent4795f161e689ef6bea563278c6a93c9ad2610ab7

handle LibExeObjStep.disable_gen_h

It is sometimes useful to skip generating of the header file (e.g. https://github.com/ziglang/zig/issues/2173), and zig compiler provides an option `--disable-gen-h` to control that behaviour. However, setting `lib.disable_gen_h = true` in a typical `build.zig` didn't append the option to arguments. This commit fixes it and adds a convenient `setDisableGenH` setter.

1 files changed, 7 insertions(+), 0 deletions(-)

std/build.zig+7
......@@ -1206,6 +1206,10 @@ pub const LibExeObjStep = struct {
12061206 pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void {
12071207 self.main_pkg_path = dir_path;
12081208 }
1209
1210 pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void {
1211 self.disable_gen_h = value;
1212 }
12091213
12101214 /// Unless setOutputDir was called, this function must be called only in
12111215 /// the make step, from a step that has declared a dependency on this one.
......@@ -1433,6 +1437,9 @@ pub const LibExeObjStep = struct {
14331437 if (self.is_dynamic) {
14341438 try zig_args.append("-dynamic");
14351439 }
1440 if (self.disable_gen_h) {
1441 try zig_args.append("--disable-gen-h");
1442 }
14361443
14371444 switch (self.target) {
14381445 Target.Native => {},