# first class support for compiling C code · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e76ce2c1d0d3988359267fd3030a81a52ec99f3f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e76ce2c1d0d3988359267fd3030a81a52ec99f3f

Requested commit: e76ce2c1d0d3988359267fd3030a81a52ec99f3f

Commit: e76ce2c1d0d3988359267fd3030a81a52ec99f3f

Tree: 04e2c5c67961d5d54ba9d31b2e1601837b84a9df

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
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.

```

## Parents

- [e5d4862e145c38ffc1111ee578ddcafc1e35ad57](https://git.cafe/gitcafe/zig/commit/e5d4862e145c38ffc1111ee578ddcafc1e35ad57?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e76ce2c1d0d3988359267fd3030a81a52ec99f3f?format=markdown)
