builder: show the contents of the C .rsp file on -showcc

pull/5786/head
Delyan Angelov 2020-07-10 13:07:17 +03:00
parent 203bec634c
commit 75b7b9564a
1 changed files with 10 additions and 3 deletions

View File

@ -396,7 +396,8 @@ fn (mut v Builder) cc() {
}
// write args to response file
response_file := '${v.out_name_c}.rsp'
os.write_file(response_file, args.replace('\\', '\\\\')) or {
response_file_content := args.replace('\\', '\\\\')
os.write_file(response_file, response_file_content) or {
verror('Unable to write response file "$response_file"')
}
start:
@ -405,8 +406,14 @@ fn (mut v Builder) cc() {
cmd := '$ccompiler @$response_file'
// Run
if v.pref.is_verbose || v.pref.show_cc {
println('\n==========')
println(cmd)
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 {