diff options
| author | Motiejus Jakštys <motiejus@uber.com> | 2022-09-19 16:24:07 +0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-09-19 15:05:37 -0400 |
| commit | 4521456f66122c6348ef6980ae1eecdb94f4f110 (patch) | |
| tree | e4e8f5c133e20a448ba542def2d3d43e20d7431f /src/main.zig | |
| parent | e42f83825f1473661700f89ffd3060013261d605 (diff) | |
| download | zig-4521456f66122c6348ef6980ae1eecdb94f4f110.tar.gz zig-4521456f66122c6348ef6980ae1eecdb94f4f110.zip | |
zig cc: emit to a.out if outpath is unspecified
If `-o` is not specified for `zig cc` for linking, it should emit the
`a.out` (or equivalent) to the current directory. So then this:
$ zig cc test.c
Should result in `./a.out`.
If directory is omitted from `Compilation.EmitLoc`, it will default to
the cache directory later in the compilation chain, which will result
in `a.out` missing in the current directory.
If we specify the directory to `Compilation.EmitLoc`, it will be
handled, allegedly, correctly.
Fixes #12858
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 35610542a8..691e1da54c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2613,7 +2613,7 @@ fn buildOutputType( } }, .yes_a_out => Compilation.EmitLoc{ - .directory = null, + .directory = .{ .path = null, .handle = fs.cwd() }, .basename = a_out_basename, }, }; |
