mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
* merge master * fix blank ident & add cflag error * undo cflag changes * add missing brace * undo change to comptime * improve error message * update
This commit is contained in:
parent
28b24eeef6
commit
22c7438795
@ -70,15 +70,16 @@ fn (table &Table) has_cflag(cflag CFlag) bool {
|
||||
|
||||
// parse the flags to (table.cflags) []CFlag
|
||||
// Note: clean up big time (joe-c)
|
||||
fn (table mut Table) parse_cflag(cflag string, mod string) {
|
||||
fn (table mut Table) parse_cflag(cflag string, mod string) ?bool {
|
||||
allowed_flags := [
|
||||
'framework',
|
||||
'library',
|
||||
'I', 'l', 'L',
|
||||
]
|
||||
mut flag := cflag.trim_space()
|
||||
flag_orig := cflag.trim_space()
|
||||
mut flag := flag_orig
|
||||
if flag == '' {
|
||||
return
|
||||
return true
|
||||
}
|
||||
mut fos := ''
|
||||
mut name := ''
|
||||
@ -124,6 +125,13 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
|
||||
value = flag.trim_space()
|
||||
index = -1
|
||||
}
|
||||
if (name in ['-I', '-l', '-L']) && value == '' {
|
||||
if name == '-I' || name == '-L' {
|
||||
return error('bad #flag `$flag_orig`: missing path after `-I`')
|
||||
} else if name == '-l' {
|
||||
return error('bad #flag `$flag_orig`: missing library name after `-l`')
|
||||
}
|
||||
}
|
||||
cf := CFlag{
|
||||
mod: mod,
|
||||
os: fos,
|
||||
@ -137,7 +145,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
return true
|
||||
}
|
||||
|
||||
//TODO: implement msvc specific c_options_before_target and c_options_after_target ...
|
||||
|
Loading…
Reference in New Issue
Block a user