diff --git a/docs/markdown/Rewriter.md b/docs/markdown/Rewriter.md index 89591fa36..4550170ca 100644 --- a/docs/markdown/Rewriter.md +++ b/docs/markdown/Rewriter.md @@ -87,7 +87,7 @@ Currently, only the following function types are supported: - dependency - 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. diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index 58223015b..b344ce6ec 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -479,6 +479,8 @@ class Rewriter: node = None arg_node = None 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 arg_node = node.args elif cmd['function'] == 'target':