From eabc35340dc0fd63d70058f93c94674bc7782c19 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Sat, 2 Mar 2019 11:18:13 +0100 Subject: [PATCH] rewriter: Enforce an empty project ID string --- docs/markdown/Rewriter.md | 2 +- mesonbuild/rewriter.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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':