Skip to content

Commit 18f5ed6

Browse files
committed
builder: fix -showcc with msvc
1 parent aecdfb0 commit 18f5ed6

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

vlib/v/builder/cc.v

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ fn (mut v Builder) rebuild_cached_module(vexe string, imp_path string) string {
133133
return res
134134
}
135135

136+
fn (mut v Builder) show_cc(cmd string, response_file string, response_file_content string) {
137+
if v.pref.is_verbose || v.pref.show_cc {
138+
println('')
139+
println('=====================')
140+
println('> C compiler cmd: $cmd')
141+
if v.pref.show_cc {
142+
println('> C compiler response file $response_file:')
143+
println(response_file_content)
144+
}
145+
println('=====================')
146+
}
147+
}
148+
136149
fn (mut v Builder) cc() {
137150
if os.executable().contains('vfmt') {
138151
return
@@ -513,17 +526,8 @@ fn (mut v Builder) cc() {
513526
todo()
514527
// TODO remove
515528
cmd := '$ccompiler @$response_file'
529+
v.show_cc(cmd, response_file, response_file_content)
516530
// Run
517-
if v.pref.is_verbose || v.pref.show_cc {
518-
println('')
519-
println('=====================')
520-
println('> C compiler cmd: $cmd')
521-
if v.pref.show_cc {
522-
println('> C compiler response file $response_file:')
523-
println(response_file_content)
524-
}
525-
println('=====================')
526-
}
527531
ticks := time.ticks()
528532
res := os.exec(cmd) or {
529533
// C compilation failed.

vlib/v/builder/msvc.v

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,7 @@ pub fn (mut v Builder) cc_msvc() {
294294
cmd := '"$r.full_cl_exe_path" @$out_name_cmd_line'
295295
// It is hard to see it at first, but the quotes above ARE balanced :-| ...
296296
// Also the double quotes at the start ARE needed.
297-
if v.pref.is_verbose {
298-
println('\n========== cl cmd line:')
299-
println(cmd)
300-
println('==========\n')
301-
}
302-
// println('$cmd')
297+
v.show_cc(cmd, out_name_cmd_line, args)
303298
ticks := time.ticks()
304299
res := os.exec(cmd) or {
305300
println(err)

0 commit comments

Comments
 (0)