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

compiler: support storing temporary files under TMPDIR/v/

Fix for filepath.join not \0 terminating its result
This commit is contained in:
Delyan Angelov
2019-11-17 05:45:20 +02:00
committed by Alexander Medvednikov
parent 200fcd41ce
commit be7cf3e812
6 changed files with 92 additions and 21 deletions

View File

@ -799,6 +799,7 @@ pub fn new_v(args[]string) &V {
vgen_buf.writeln('module vgen\nimport strings')
joined_args := args.join(' ')
target_os := get_arg(joined_args, 'os', '')
comptime_define := get_arg(joined_args, 'd', '')
//println('comptimedefine=$comptime_define')
@ -930,8 +931,8 @@ pub fn new_v(args[]string) &V {
println('Go to https://vlang.io to install V.')
exit(1)
}
// println('out_name:$out_name')
mut out_name_c := os.realpath('${out_name}.tmp.c')
mut out_name_c := get_vtmp_filename( out_name, '.tmp.c')
cflags := get_cmdline_cflags(args)
@ -978,7 +979,7 @@ pub fn new_v(args[]string) &V {
println('C compiler=$pref.ccompiler')
}
if pref.is_so {
out_name_c = out_name.all_after(os.path_separator) + '_shared_lib.c'
out_name_c = get_vtmp_filename( out_name, '.tmp.so.c')
}
$if !linux {
if pref.is_bare && !out_name.ends_with('.c') {