authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-25 14:27:03-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-02-25 14:27:03-05:00
log33cbb29def181ee758b1f8bb93d8d81a4e377ce1
treef6e9ea25cfa8ed5312c864f8075aae5a0d58aa46
parent6003b1ea7018fe6a7aa87622d1178e444e6d8abb
signaturelock-open Commit is signed but in an unrecognized format.

zig build: 2 improvements

* `linkLibrary` will make the target depend on libc if the source does * when building C source file(s), don't try to generate .h files

1 files changed, 5 insertions(+), 1 deletions(-)

std/build.zig+5-1
......@@ -1011,6 +1011,10 @@ pub const LibExeObjStep = struct {
10111011 self.full_path_libs.append(lib.getOutputPath()) catch unreachable;
10121012 }
10131013
1014 if (lib.link_libs.exists("c")) {
1015 self.link_libs.put("c") catch unreachable;
1016 }
1017
10141018 // TODO should be some kind of isolated directory that only has this header in it
10151019 self.include_dirs.append(self.builder.cache_root) catch unreachable;
10161020 self.need_flat_namespace_hack = true;
......@@ -1266,7 +1270,7 @@ pub const LibExeObjStep = struct {
12661270 zig_args.append(output_lib_path) catch unreachable;
12671271 }
12681272
1269 if (self.kind != Kind.Exe) {
1273 if (self.kind != Kind.Exe and self.root_src != null) {
12701274 const output_h_path = self.getOutputHPath();
12711275 zig_args.append("--output-h") catch unreachable;
12721276 zig_args.append(builder.pathFromRoot(output_h_path)) catch unreachable;