@ -24,13 +24,14 @@ forbidden_option_names = set(coredata.builtin_options.keys())
forbidden_prefixes = [ lang + ' _ ' for lang in compilers . all_languages ] + [ ' b_ ' , ' backend_ ' ]
forbidden_prefixes = [ lang + ' _ ' for lang in compilers . all_languages ] + [ ' b_ ' , ' backend_ ' ]
reserved_prefixes = [ ' cross_ ' ]
reserved_prefixes = [ ' cross_ ' ]
def is_invalid_name ( name : str ) - > bool :
def is_invalid_name ( name : str , * , log : bool = True ) - > bool :
if name in forbidden_option_names :
if name in forbidden_option_names :
return True
return True
pref = name . split ( ' _ ' ) [ 0 ] + ' _ '
pref = name . split ( ' _ ' ) [ 0 ] + ' _ '
if pref in forbidden_prefixes :
if pref in forbidden_prefixes :
return True
return True
if pref in reserved_prefixes :
if pref in reserved_prefixes :
if log :
from . import mlog
from . import mlog
mlog . deprecation ( ' Option uses prefix " %s " , which is reserved for Meson. This will become an error in the future. ' % pref )
mlog . deprecation ( ' Option uses prefix " %s " , which is reserved for Meson. This will become an error in the future. ' % pref )
return False
return False