store temp C files in the same directory

pull/1170/head
Alexander Medvednikov 2019-07-16 02:12:05 +02:00
parent 9c63cac54d
commit eb7aee5ae0
2 changed files with 4 additions and 4 deletions

View File

@ -33,8 +33,7 @@ mut:
}
fn new_cgen(out_name_c string) *CGen {
//println('TmpPath: "$TmpPath"')
path:='$TmpPath/$out_name_c'
path:='.$out_name_c'
out := os.create(path) or {
println('failed to create $path')
return &CGen{}

View File

@ -597,7 +597,8 @@ mut args := ''
// else {
a << '-o $v.out_name'
// The C file we are compiling
a << '"$TmpPath/$v.out_name_c"'
//a << '"$TmpPath/$v.out_name_c"'
a << '".$v.out_name_c"'
// }
// Min macos version is mandatory I think?
if v.os == .mac {
@ -662,7 +663,7 @@ mut args := ''
println('linux cross compilation done. resulting binary: "$v.out_name"')
}
if !v.pref.is_debug && v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' {
//os.rm('$TmpPath/$v.out_name_c')
os.rm('.$v.out_name_c')
}
}