diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 4365bf2693..b847a6999e 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -133,6 +133,19 @@ fn (mut v Builder) rebuild_cached_module(vexe string, imp_path string) string { 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() { if os.executable().contains('vfmt') { return @@ -513,17 +526,8 @@ fn (mut v Builder) cc() { todo() // TODO remove cmd := '$ccompiler @$response_file' + v.show_cc(cmd, response_file, response_file_content) // 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() res := os.exec(cmd) or { // C compilation failed. diff --git a/vlib/v/builder/msvc.v b/vlib/v/builder/msvc.v index 6390151508..0ffe671353 100644 --- a/vlib/v/builder/msvc.v +++ b/vlib/v/builder/msvc.v @@ -294,12 +294,7 @@ pub fn (mut v Builder) cc_msvc() { cmd := '"$r.full_cl_exe_path" @$out_name_cmd_line' // It is hard to see it at first, but the quotes above ARE balanced :-| ... // Also the double quotes at the start ARE needed. - if v.pref.is_verbose { - println('\n========== cl cmd line:') - println(cmd) - println('==========\n') - } - // println('$cmd') + v.show_cc(cmd, out_name_cmd_line, args) ticks := time.ticks() res := os.exec(cmd) or { println(err)