mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: improved error, when c compiler is missing/not found.
This commit is contained in:
parent
329e7bd2c8
commit
4a27b8f43d
@ -892,6 +892,17 @@ mut args := ''
|
|||||||
ticks := time.ticks()
|
ticks := time.ticks()
|
||||||
res := os.exec(cmd) or { panic(err) }
|
res := os.exec(cmd) or { panic(err) }
|
||||||
if res.exit_code != 0 {
|
if res.exit_code != 0 {
|
||||||
|
|
||||||
|
if res.exit_code == 127 {
|
||||||
|
// the command could not be found by the system
|
||||||
|
panic('C compiler error, while attempting to run: \n' +
|
||||||
|
'-----------------------------------------------------------\n' +
|
||||||
|
'$cmd\n' +
|
||||||
|
'-----------------------------------------------------------\n' +
|
||||||
|
'Probably your C compiler is missing. \n' +
|
||||||
|
'Please reinstall it, or make it available in your PATH.')
|
||||||
|
}
|
||||||
|
|
||||||
if v.pref.is_debug {
|
if v.pref.is_debug {
|
||||||
println(res.output)
|
println(res.output)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user