Skip to content

Commit

Permalink
Add a new feature warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bcorby committed Dec 17, 2024
1 parent 6732933 commit 928f687
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ def get_option_internal(self, optname: str) -> options.UserOption:
@noKwargs
def func_get_option(self, nodes: mparser.BaseNode, args: T.Tuple[str],
kwargs: 'TYPE_kwargs') -> T.Union[options.UserOption, 'TYPE_var']:
self.get_option_used = True
optname = args[0]
if ':' in optname:
raise InterpreterException('Having a colon in option name is forbidden, '
Expand Down Expand Up @@ -1209,6 +1210,10 @@ def func_project(self, node: mparser.FunctionNode, args: T.Tuple[str, T.List[str
else:
FeatureNew.single_use('meson.options file', '1.1', self.subproject, 'Use meson_options.txt instead')

# Warn about using get_option() in project().
if hasattr(self, 'get_option_used'):
FeatureNew.single_use('Using get_option() function as a parameter to project()', '1.7', self.subproject)

if self.subproject:
self.project_default_options = {k.evolve(subproject=self.subproject): v
for k, v in kwargs['default_options'].items()}
Expand Down

0 comments on commit 928f687

Please sign in to comment.