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

compiler: remove -keepc option (it is now always on)

This commit is contained in:
Delyan Angelov
2020-07-06 13:42:11 +03:00
parent c94038af89
commit 25771a1afe
9 changed files with 7 additions and 23 deletions

View File

@@ -482,9 +482,6 @@ fn (mut v Builder) cc() {
println('linux cross compilation done. resulting binary: "$v.out_name"')
}
*/
if !v.pref.keep_c && v.out_name_c != 'v.c' {
os.rm(v.out_name_c)
}
if v.pref.compress {
$if windows {
println('-compress does not work on Windows for now')

View File

@@ -192,10 +192,6 @@ fn find_msvc() ?MsvcResult {
pub fn (mut v Builder) cc_msvc() {
r := find_msvc() or {
// TODO: code reuse
if !v.pref.keep_c && v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' {
os.rm(v.out_name_c)
}
verror('Cannot find MSVC on this OS')
return
}
@@ -309,9 +305,6 @@ pub fn (mut v Builder) cc_msvc() {
}
// println(res)
// println('C OUTPUT:')
if !v.pref.keep_c && v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' {
os.rm(v.out_name_c)
}
// Always remove the object file - it is completely unnecessary
os.rm(out_name_obj)
}

View File

@@ -82,7 +82,7 @@ fn (g &Gen) generate_hotcode_reloading_main_caller() {
file := util.cescaped_path( g.pref.path )
msvc := if g.pref.ccompiler == 'msvc' { '-cc msvc' } else { '' }
so_debug_flag := if g.pref.is_debug { '-cg' } else { '' }
vopts := '$msvc $so_debug_flag -keepc -sharedlive -shared'
vopts := '$msvc $so_debug_flag -sharedlive -shared'
//
g.writeln('\t\t// start background reloading thread')
if g.pref.os == .windows {

View File

@@ -69,7 +69,6 @@ pub mut:
sanitize bool // use Clang's new "-fsanitize" option
is_debug bool // false by default, turned on by -g or -cg, it tells v to pass -g to the C backend compiler.
is_vlines bool // turned on by -g, false by default (it slows down .tmp.c generation slightly).
keep_c bool // -keepc , tell v to leave the generated .tmp.c alone (since by default v will delete them after c backend finishes)
show_cc bool // -showcc, print cc command
// NB: passing -cg instead of -g will set is_vlines to false and is_g to true, thus making v generate cleaner C files,
// which are sometimes easier to debug / inspect manually than the .tmp.c files by plain -g (when/if v line number generation breaks).
@@ -197,7 +196,7 @@ pub fn parse_args(args []string) (&Preferences, string) {
res.use_cache = true
}
'-keepc' {
res.keep_c = true
eprintln('-keepc is deprecated. V always keeps the generated .tmp.c files now.')
}
'-parallel' {
res.is_parallel = true

View File

@@ -38,7 +38,7 @@ fn test_all() {
full_test_path := os.real_path(test)
println('x.v: $wrkdir/x.v')
os.system('cp ${dir}/${test} $wrkdir/x.v') // cant run .vv file
compile_cmd := '$vexe -cflags "-w" -verbose=3 -autofree -keepc -cg $wrkdir/x.v'
compile_cmd := '$vexe -cflags "-w" -verbose=3 -autofree -cg $wrkdir/x.v'
vprintln('compile cmd: $compile_cmd')
res := os.exec(compile_cmd) or {
bench.fail()