Reserve cross_ option prefix for Meson.

pull/5120/head
Jussi Pakkanen 6 years ago committed by Nirbheek Chauhan
parent 7a02b76e70
commit 3d0b110ec2
  1. 4
      mesonbuild/optinterpreter.py

@ -22,6 +22,7 @@ from . import compilers
forbidden_option_names = coredata.get_builtin_options()
forbidden_prefixes = [lang + '_' for lang in compilers.all_languages] + ['b_', 'backend_']
reserved_prefixes = ['cross_']
def is_invalid_name(name):
if name in forbidden_option_names:
@ -29,6 +30,9 @@ def is_invalid_name(name):
pref = name.split('_')[0] + '_'
if pref in forbidden_prefixes:
return True
if pref in reserved_prefixes:
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
class OptionException(mesonlib.MesonException):

Loading…
Cancel
Save