Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig cc: expose clang precompiled C header support #18600

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

xxxbxxx
Copy link
Contributor

@xxxbxxx xxxbxxx commented Jan 17, 2024

see https://releases.llvm.org/17.0.1/tools/clang/docs/UsersManual.html#generating-a-pch-file

syntax examples:
zig cc -x c-header test.h -o test.pch
zig cc -include-pch test.pch main.c

zig c++ -x c++-header test.h -o test.pch
zig c++ -include-pch test.pch main.cpp

compiling mold now works:
CC="zig cc" CXX="zig c++" ASM="zig cc" cmake .. -G Ninja && ninja
closes #18343

extracted from #17956 as a first step.

see https://releases.llvm.org/17.0.1/tools/clang/docs/UsersManual.html#generating-a-pch-file

syntax examples:
`zig cc -x c-header test.h -o test.pch`
`zig cc -include-pch test.pch main.c`

`zig c++ -x c++-header test.h -o test.pch`
`zig c++ -include-pch test.pch main.cpp`
matu3ba added a commit to matu3ba/win32acl that referenced this pull request Jan 19, 2024
@andrewrk andrewrk merged commit 1a98fcd into ziglang:master Jan 20, 2024
10 checks passed
@xxxbxxx xxxbxxx deleted the pch-support-cc branch August 4, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiling Mold with zig c++ fails, likely due to -x <language> flag
2 participants