You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
This:
zig/src/main.zig
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 geta.out
(froma.c
),b.h.gch
, andc.h.gch
.For Zig, if you type
zig cc a.c -x c-header b.h -x c-header c.h
, you geta.c.pch
,b.h.pch
, andc.h.pch
! Omitting the-x c-header
makeszig 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:
zig/src/Compilation.zig
Lines 5697 to 5699 in d48611b
cc @xxxbxxx (#18600)
The text was updated successfully, but these errors were encountered: