@ -24,15 +24,16 @@ 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 :
from . import mlog
if log :
mlog . deprecation ( ' Option uses prefix " %s " , which is reserved for Meson. This will become an error in the future. ' % pref )
from . import mlog
mlog . deprecation ( ' Option uses prefix " %s " , which is reserved for Meson. This will become an error in the future. ' % pref )
return False
return False
class OptionException ( mesonlib . MesonException ) :
class OptionException ( mesonlib . MesonException ) :