diff options
| author | Tamas Kenez <tamas.kenez@shapr3d.com> | 2021-08-14 13:58:46 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-08-21 14:49:01 +0300 |
| commit | 4c18da1ef3ef21033394041be21774bf13882b54 (patch) | |
| tree | 19508d193e02a964728839080bea0333e8c2eab6 /src/Compilation.zig | |
| parent | bbb96e112cc555fd63fe305398c5b89b778e9c81 (diff) | |
| download | zig-4c18da1ef3ef21033394041be21774bf13882b54.tar.gz zig-4c18da1ef3ef21033394041be21774bf13882b54.zip | |
Fix args when calling clang::ASTUnit::LoadFromCommandLine.
clang::ASTUnit::LoadFromCommandLine interprets the first argument as
the name of program (like the main function).
This change shifts the arguments passing "" for the first argument.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 7987ed95df..7dc726aeb2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2557,6 +2557,7 @@ pub fn cImport(comp: *Compilation, c_src: []const u8) !CImportResult { var argv = std.ArrayList([]const u8).init(comp.gpa); defer argv.deinit(); + try argv.append(""); // argv[0] is program name, actual args start at [1] try comp.addTranslateCCArgs(arena, &argv, .c, out_dep_path); try argv.append(out_h_path); |
