diff options
| author | Xavier Bouchoux <xavierb@gmail.com> | 2023-11-10 13:59:56 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-19 22:05:09 -0800 |
| commit | 1a98fcd00abb7266418532a103214467497d58c6 (patch) | |
| tree | 39254a968f9777852e246ec5c803983656c479e4 /src/link.zig | |
| parent | 314533c28bdb57f4cdc159fe376a10037e72d5f3 (diff) | |
| download | zig-1a98fcd00abb7266418532a103214467497d58c6.tar.gz zig-1a98fcd00abb7266418532a103214467497d58c6.zip | |
zig cc: expose clang precompiled C header support
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`
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/link.zig b/src/link.zig index ec5138fcde..8bd481b399 100644 --- a/src/link.zig +++ b/src/link.zig @@ -554,7 +554,7 @@ pub const File = struct { return @fieldParentPtr(C, "base", base).flush(arena, prog_node); } const comp = base.comp; - if (comp.clang_preprocessor_mode == .yes) { + if (comp.clang_preprocessor_mode == .yes or comp.clang_preprocessor_mode == .pch) { const gpa = comp.gpa; const emit = base.emit; // TODO: avoid extra link step when it's just 1 object file (the `zig cc -c` case) |
