Description
This:
Lines 2654 to 2657 in d48611b
is not the right way to handle PCHs.
When you type gcc a.c b.h c.h
, you get a.out
(from a.c
), b.h.gch
, and c.h.gch
.
For Zig, if you type zig cc a.c -x c-header b.h -x c-header c.h
, you get a.c.pch
, b.h.pch
, and c.h.pch
! Omitting the -x c-header
makes zig cc
think you want to link the resulting PCH files and fails as you'd expect.
In other words, the -x
should not be necessary; PCH handling should come into effect simply when header files are passed to the compiler. Additionally, compiling PCHs should not preclude compiling a normal binary.
Rather than have PCH handling impact the main compiler mode, I think PCH compilation should be handled as a 'secondary task' similar to the dependency file:
Lines 5697 to 5699 in d48611b