Skip to content

Commit b4e64ee

Browse files
committed
v.builder: cleanup noise by msvc rebuilding object files, unless -d trace_thirdparty_obj_files is passed
1 parent a26a42d commit b4e64ee

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vlib/v/builder/msvc_windows.v

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,9 @@ fn (mut v Builder) build_thirdparty_obj_file_with_msvc(_mod string, path string,
434434
// println('$obj_path already built.')
435435
return
436436
}
437-
println('${obj_path} not found, building it (with msvc)...')
438-
flush_stdout()
437+
$if trace_thirdparty_obj_files ? {
438+
println('${obj_path} not found, building it (with msvc)...')
439+
}
439440
cfile := if os.exists('${path_without_o_postfix}.c') {
440441
'${path_without_o_postfix}.c'
441442
} else {
@@ -481,7 +482,6 @@ fn (mut v Builder) build_thirdparty_obj_file_with_msvc(_mod string, path string,
481482
// Note: the quotes above ARE balanced.
482483
$if trace_thirdparty_obj_files ? {
483484
println('>>> build_thirdparty_obj_file_with_msvc cmd: ${cmd}')
484-
flush_stdout()
485485
}
486486
// Note, that building object files with msvc can fail with permission denied errors,
487487
// when the final .obj file, is locked by another msvc process for writing, or linker errors.
@@ -507,8 +507,9 @@ fn (mut v Builder) build_thirdparty_obj_file_with_msvc(_mod string, path string,
507507
if res.exit_code != 0 {
508508
verror('msvc: failed to build a thirdparty object after ${i}/${thirdparty_obj_build_max_retries} retries, cmd: ${cmd}')
509509
}
510-
println(res.output)
511-
flush_stdout()
510+
$if trace_thirdparty_obj_files ? {
511+
println(res.output)
512+
}
512513
}
513514

514515
const thirdparty_obj_build_max_retries = 5

0 commit comments

Comments
 (0)