1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.builder: fix quoting when building thirdparty source files

This commit is contained in:
Delyan Angelov 2020-08-16 10:18:14 +03:00
parent 29528196f2
commit fc7a108366

View File

@ -744,18 +744,18 @@ fn (mut v Builder) build_thirdparty_obj_file(path string, moduleflags []cflag.CF
return
}
println('$obj_path not found, building it...')
cfiles := '${path[..path.len-2]}.c'
cfile := '${path[..path.len-2]}.c'
btarget := moduleflags.c_options_before_target()
atarget := moduleflags.c_options_after_target()
cppoptions := if v.pref.ccompiler.contains('++') { ' -fpermissive -w ' } else { '' }
cmd := '$v.pref.ccompiler $cppoptions $v.pref.third_party_option $btarget -c -o "$obj_path" $cfiles $atarget'
cmd := '$v.pref.ccompiler $cppoptions $v.pref.third_party_option $btarget -c -o "$obj_path" "$cfile" $atarget'
res := os.exec(cmd) or {
println('failed thirdparty object build cmd: $cmd')
eprintln('exec failed for thirdparty object build cmd:\n$cmd')
verror(err)
return
}
if res.exit_code != 0 {
println('failed thirdparty object build cmd: $cmd')
eprintln('failed thirdparty object build cmd:\n$cmd')
verror(res.output)
return
}