mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builder: replace single goto start
usage, with for { ... continue ... break}
This commit is contained in:
parent
c5cd53ca79
commit
394e9c4c56
@ -225,9 +225,9 @@ fn (mut v Builder) cc() {
|
|||||||
//
|
//
|
||||||
mut tried_compilation_commands := []string{}
|
mut tried_compilation_commands := []string{}
|
||||||
original_pwd := os.getwd()
|
original_pwd := os.getwd()
|
||||||
// TODO remove the start: goto start construct;
|
for {
|
||||||
// use a labeled for break instead
|
// try to compile with the choosen compiler
|
||||||
start:
|
// if compilation fails, retry again with another
|
||||||
mut ccompiler := v.pref.ccompiler
|
mut ccompiler := v.pref.ccompiler
|
||||||
$if windows {
|
$if windows {
|
||||||
if ccompiler == 'msvc' {
|
if ccompiler == 'msvc' {
|
||||||
@ -560,7 +560,7 @@ fn (mut v Builder) cc() {
|
|||||||
}
|
}
|
||||||
eprintln('recompilation with tcc failed; retrying with cc ...')
|
eprintln('recompilation with tcc failed; retrying with cc ...')
|
||||||
v.pref.ccompiler = pref.default_c_compiler()
|
v.pref.ccompiler = pref.default_c_compiler()
|
||||||
goto start
|
continue
|
||||||
}
|
}
|
||||||
if res.exit_code == 127 {
|
if res.exit_code == 127 {
|
||||||
verror('C compiler error, while attempting to run: \n' +
|
verror('C compiler error, while attempting to run: \n' +
|
||||||
@ -577,6 +577,8 @@ fn (mut v Builder) cc() {
|
|||||||
println('$ccompiler took $diff ms')
|
println('$ccompiler took $diff ms')
|
||||||
println('=========\n')
|
println('=========\n')
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
// Link it if we are cross compiling and need an executable
|
// Link it if we are cross compiling and need an executable
|
||||||
/*
|
/*
|
||||||
if v.os == .linux && !linux_host && v.pref.build_mode != .build {
|
if v.os == .linux && !linux_host && v.pref.build_mode != .build {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user