builder: fix -showcc with msvc

pull/6729/head
Delyan Angelov 2020-11-03 12:37:04 +02:00
parent aecdfb06e7
commit 18f5ed671d
2 changed files with 15 additions and 16 deletions

View File

@ -133,6 +133,19 @@ fn (mut v Builder) rebuild_cached_module(vexe string, imp_path string) string {
return res return res
} }
fn (mut v Builder) show_cc(cmd string, response_file string, response_file_content string) {
if v.pref.is_verbose || v.pref.show_cc {
println('')
println('=====================')
println('> C compiler cmd: $cmd')
if v.pref.show_cc {
println('> C compiler response file $response_file:')
println(response_file_content)
}
println('=====================')
}
}
fn (mut v Builder) cc() { fn (mut v Builder) cc() {
if os.executable().contains('vfmt') { if os.executable().contains('vfmt') {
return return
@ -513,17 +526,8 @@ fn (mut v Builder) cc() {
todo() todo()
// TODO remove // TODO remove
cmd := '$ccompiler @$response_file' cmd := '$ccompiler @$response_file'
v.show_cc(cmd, response_file, response_file_content)
// Run // Run
if v.pref.is_verbose || v.pref.show_cc {
println('')
println('=====================')
println('> C compiler cmd: $cmd')
if v.pref.show_cc {
println('> C compiler response file $response_file:')
println(response_file_content)
}
println('=====================')
}
ticks := time.ticks() ticks := time.ticks()
res := os.exec(cmd) or { res := os.exec(cmd) or {
// C compilation failed. // C compilation failed.

View File

@ -294,12 +294,7 @@ pub fn (mut v Builder) cc_msvc() {
cmd := '"$r.full_cl_exe_path" @$out_name_cmd_line' cmd := '"$r.full_cl_exe_path" @$out_name_cmd_line'
// It is hard to see it at first, but the quotes above ARE balanced :-| ... // It is hard to see it at first, but the quotes above ARE balanced :-| ...
// Also the double quotes at the start ARE needed. // Also the double quotes at the start ARE needed.
if v.pref.is_verbose { v.show_cc(cmd, out_name_cmd_line, args)
println('\n========== cl cmd line:')
println(cmd)
println('==========\n')
}
// println('$cmd')
ticks := time.ticks() ticks := time.ticks()
res := os.exec(cmd) or { res := os.exec(cmd) or {
println(err) println(err)