From e76ce2c1d0d3988359267fd3030a81a52ec99f3f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 25 Feb 2019 11:37:54 -0500 Subject: first class support for compiling C code New CLI parameter: --c-source [options] [file] It even works with `--cache on` when there are transitive dependencies. Instead of `builder.addCExecutable`, use `builder.addExecutable` and pass `null` for the root source file. Then use `builder.addCSourceFile`, which takes the path to the C code, and a list of C compiler args. Be sure to linkSystemLibrary("c") if you want libc headers to be available. Merge TestStep into LibExeObjStep. That was long overdue. --- std/buf_set.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'std/buf_set.zig') diff --git a/std/buf_set.zig b/std/buf_set.zig index 7ccd94c179..484b4953b9 100644 --- a/std/buf_set.zig +++ b/std/buf_set.zig @@ -32,6 +32,10 @@ pub const BufSet = struct { } } + pub fn exists(self: BufSet, key: []const u8) bool { + return self.hash_map.get(key) != null; + } + pub fn delete(self: *BufSet, key: []const u8) void { const entry = self.hash_map.remove(key) orelse return; self.free(entry.key); -- cgit v1.2.3