rewriter: Enforce an empty project ID string

pull/4992/head
Daniel Mensinger 6 years ago
parent 8fad06e8c8
commit eabc35340d
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 2
      docs/markdown/Rewriter.md
  2. 2
      mesonbuild/rewriter.py

@ -87,7 +87,7 @@ Currently, only the following function types are supported:
- dependency - dependency
- target (any build target, the function ID is the target name/ID) - target (any build target, the function ID is the target name/ID)
- project (the function ID can be anything since project() can only be called once) - project (the function ID must be an empty string since project() can only be called once)
For more information see the help output of the rewriter kwargs command. For more information see the help output of the rewriter kwargs command.

@ -479,6 +479,8 @@ class Rewriter:
node = None node = None
arg_node = None arg_node = None
if cmd['function'] == 'project': if cmd['function'] == 'project':
if cmd['id'] != '':
mlog.error('The ID for the function type project must be an empty string --> skipping')
node = self.interpreter.project_node node = self.interpreter.project_node
arg_node = node.args arg_node = node.args
elif cmd['function'] == 'target': elif cmd['function'] == 'target':

Loading…
Cancel
Save