* merge master * fix blank ident & add cflag error * undo cflag changes * add missing brace * undo change to comptime * improve error message * updatepull/2420/head
parent
28b24eeef6
commit
22c7438795
|
@ -70,15 +70,16 @@ fn (table &Table) has_cflag(cflag CFlag) bool {
|
||||||
|
|
||||||
// parse the flags to (table.cflags) []CFlag
|
// parse the flags to (table.cflags) []CFlag
|
||||||
// Note: clean up big time (joe-c)
|
// 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 := [
|
allowed_flags := [
|
||||||
'framework',
|
'framework',
|
||||||
'library',
|
'library',
|
||||||
'I', 'l', 'L',
|
'I', 'l', 'L',
|
||||||
]
|
]
|
||||||
mut flag := cflag.trim_space()
|
flag_orig := cflag.trim_space()
|
||||||
|
mut flag := flag_orig
|
||||||
if flag == '' {
|
if flag == '' {
|
||||||
return
|
return true
|
||||||
}
|
}
|
||||||
mut fos := ''
|
mut fos := ''
|
||||||
mut name := ''
|
mut name := ''
|
||||||
|
@ -124,6 +125,13 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
|
||||||
value = flag.trim_space()
|
value = flag.trim_space()
|
||||||
index = -1
|
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{
|
cf := CFlag{
|
||||||
mod: mod,
|
mod: mod,
|
||||||
os: fos,
|
os: fos,
|
||||||
|
@ -137,7 +145,7 @@ fn (table mut Table) parse_cflag(cflag string, mod string) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: implement msvc specific c_options_before_target and c_options_after_target ...
|
//TODO: implement msvc specific c_options_before_target and c_options_after_target ...
|
||||||
|
|
Loading…
Reference in New Issue