mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: update & enable cflag error (#2420)
* merge master * update & enable cflag error
This commit is contained in:
parent
22c7438795
commit
b51b8858d6
@ -126,12 +126,9 @@ fn (table mut Table) parse_cflag(cflag string, mod string) ?bool {
|
|||||||
index = -1
|
index = -1
|
||||||
}
|
}
|
||||||
if (name in ['-I', '-l', '-L']) && value == '' {
|
if (name in ['-I', '-l', '-L']) && value == '' {
|
||||||
if name == '-I' || name == '-L' {
|
hint := if name == '-l' { 'library name' } else { 'path' }
|
||||||
return error('bad #flag `$flag_orig`: missing path after `-I`')
|
return error('bad #flag `$flag_orig`: missing $hint after `$name`')
|
||||||
} else if name == '-l' {
|
}
|
||||||
return error('bad #flag `$flag_orig`: missing library name after `-l`')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cf := CFlag{
|
cf := CFlag{
|
||||||
mod: mod,
|
mod: mod,
|
||||||
os: fos,
|
os: fos,
|
||||||
|
@ -185,7 +185,9 @@ fn (p mut Parser) chash() {
|
|||||||
flag = flag.replace('@VROOT', p.vroot)
|
flag = flag.replace('@VROOT', p.vroot)
|
||||||
flag = flag.replace('@VMOD', v_modules_path)
|
flag = flag.replace('@VMOD', v_modules_path)
|
||||||
//p.log('adding flag "$flag"')
|
//p.log('adding flag "$flag"')
|
||||||
p.table.parse_cflag(flag, p.mod)
|
_ = p.table.parse_cflag(flag, p.mod) or {
|
||||||
|
p.error_with_token_index(err, p.cur_tok_index()-1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user