# stage2: properly handle zig cc used as a preprocessor · gitcafe/zig

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

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

Visibility: public

Requested revision: a337046832b936d912b6902e331cb58bdc513a2d

Requested commit: a337046832b936d912b6902e331cb58bdc513a2d

Commit: a337046832b936d912b6902e331cb58bdc513a2d

Tree: 2475300223038682fad3477d5e59473b78992a5b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: properly handle zig cc used as a preprocessor

This cleans up how the CLI parses and handles -E, -S, and -c.
Compilation explicitly acknowledges when it is being used to do C
preprocessing.

-S is properly translated to -fno-emit-bin -femit-asm but Compilation
does not yet handle -femit-asm.

There is not yet a mechanism for skipping the linking step when there is
only a single object file, and so to make this work we have to do a file
copy in link.flush() to copy the file from zig-cache into the output
directory.

```

## Parents

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

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