diff options
| author | Ruslan Prokopchuk <fer.obbee@gmail.com> | 2019-04-04 09:21:55 +1100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-04-03 18:31:25 -0400 |
| commit | 70ae3222b54c05fc88e9c94a1ae12ead07fa4341 (patch) | |
| tree | 63ef60e5b3e65485544e0a6536d0baa157059be3 /std/build.zig | |
| parent | 4795f161e689ef6bea563278c6a93c9ad2610ab7 (diff) | |
| download | zig-70ae3222b54c05fc88e9c94a1ae12ead07fa4341.tar.gz zig-70ae3222b54c05fc88e9c94a1ae12ead07fa4341.zip | |
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.
Diffstat (limited to 'std/build.zig')
| -rw-r--r-- | std/build.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/std/build.zig b/std/build.zig index 6409d625d8..f0c4330660 100644 --- a/std/build.zig +++ b/std/build.zig @@ -1206,6 +1206,10 @@ pub const LibExeObjStep = struct { pub fn setMainPkgPath(self: *LibExeObjStep, dir_path: []const u8) void { self.main_pkg_path = dir_path; } + + pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void { + self.disable_gen_h = value; + } /// Unless setOutputDir was called, this function must be called only in /// the make step, from a step that has declared a dependency on this one. @@ -1433,6 +1437,9 @@ pub const LibExeObjStep = struct { if (self.is_dynamic) { try zig_args.append("-dynamic"); } + if (self.disable_gen_h) { + try zig_args.append("--disable-gen-h"); + } switch (self.target) { Target.Native => {}, |
