diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-18 14:26:41 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-09-24 20:01:18 -0700 |
| commit | 01d993b2305961100d2e898270b7a6be832d0fa7 (patch) | |
| tree | fe4c303c821978dd449325983ada3a5b7a496b24 /src/Compilation.zig | |
| parent | 8e27821b604ebbeadecc42efa4e42098f6662f10 (diff) | |
| download | zig-01d993b2305961100d2e898270b7a6be832d0fa7.tar.gz zig-01d993b2305961100d2e898270b7a6be832d0fa7.zip | |
add translate-c CLI args
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 6e27d339f8..cf911bd348 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -6600,6 +6600,20 @@ pub fn tmpFilePath(comp: Compilation, ally: Allocator, suffix: []const u8) error } } +pub fn addTranslateCCArgs( + comp: *Compilation, + arena: Allocator, + argv: *std.ArrayList([]const u8), + ext: FileExt, + out_dep_path: ?[]const u8, + owner_mod: *Package.Module, +) !void { + try argv.appendSlice(&.{ "-x", "c" }); + try comp.addCCArgs(arena, argv, ext, out_dep_path, owner_mod); + // This gives us access to preprocessing entities, presumably at the cost of performance. + try argv.appendSlice(&.{ "-Xclang", "-detailed-preprocessing-record" }); +} + /// Add common C compiler args between translate-c and C object compilation. pub fn addCCArgs( comp: *const Compilation, |
