authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-24 15:19:31-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-24 15:19:31-07:00
loga9af4727286734cd9b05d3b031e6d5c1834a6a8b
tree1fa7cc529ef59d91240184a2eac123a7c308ed88
parent07afd5bdbaef991a177e2df03af0502fce5dde23

Compilation: move comptime condition first

Avoids compile error on Windows due to not having execv capabilities. Fixup for eb3f7d2f37cab1d3df7c4493b8239e802b83e521. See #6768

1 files changed, 3 insertions(+), 1 deletions(-)

src/Compilation.zig+3-1
...@@ -3767,7 +3767,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P...@@ -3767,7 +3767,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P
3767 // that we could "tail call" clang by doing an execve, and any use of3767 // that we could "tail call" clang by doing an execve, and any use of
3768 // the caching system would actually be problematic since the user is3768 // the caching system would actually be problematic since the user is
3769 // presumably doing their own caching by using dep file flags.3769 // presumably doing their own caching by using dep file flags.
3770 if (comp.disable_c_depfile and comp.clang_passthrough_mode and std.process.can_execv and direct_o) {3770 if (std.process.can_execv and direct_o and
3771 comp.disable_c_depfile and comp.clang_passthrough_mode)
3772 {
3771 try comp.addCCArgs(arena, &argv, ext, null);3773 try comp.addCCArgs(arena, &argv, ext, null);
37723774
3773 const out_obj_path = if (comp.bin_file.options.emit) |emit|3775 const out_obj_path = if (comp.bin_file.options.emit) |emit|