mirror of
https://github.com/ziglang/zig.git
synced 2026-01-07 14:03:26 +00:00
zig cc: special handling of /dev/null
Now we handle -o /dev/null equivalent to -fno-emit-bin because otherwise our atomic rename into place will fail. This also makes Zig do less work, avoiding pointless file system operations.
This commit is contained in:
parent
331cc810de
commit
e1375942e5
11
src/main.zig
11
src/main.zig
@ -1317,7 +1317,16 @@ fn buildOutputType(
|
||||
};
|
||||
switch (it.zig_equivalent) {
|
||||
.target => target_arch_os_abi = it.only_arg, // example: -target riscv64-linux-unknown
|
||||
.o => out_path = it.only_arg, // -o
|
||||
.o => {
|
||||
// We handle -o /dev/null equivalent to -fno-emit-bin because
|
||||
// otherwise our atomic rename into place will fail. This also
|
||||
// makes Zig do less work, avoiding pointless file system operations.
|
||||
if (mem.eql(u8, it.only_arg, "/dev/null")) {
|
||||
emit_bin = .no;
|
||||
} else {
|
||||
out_path = it.only_arg;
|
||||
}
|
||||
},
|
||||
.c => c_out_mode = .object, // -c
|
||||
.asm_only => c_out_mode = .assembly, // -S
|
||||
.preprocess_only => c_out_mode = .preprocessor, // -E
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user