aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreter/interpreter.py2
-rw-r--r--test cases/common/33 run program/meson.build2
-rw-r--r--test cases/common/33 run program/test.json8
3 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index c6602a5..0c058f6 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -528,6 +528,7 @@ class Interpreter(InterpreterBase, HoldableObject):
def handle_meson_version(self, pv: str, location: mparser.BaseNode) -> None:
if not mesonlib.version_compare(coredata.version, pv):
raise InterpreterException.from_node(f'Meson version is {coredata.version} but project requires {pv}', node=location)
+ mesonlib.project_meson_versions[self.subproject] = pv
def handle_meson_version_from_ast(self) -> None:
if not self.ast.lines:
@@ -1170,7 +1171,6 @@ class Interpreter(InterpreterBase, HoldableObject):
# for things like deprecation testing.
if kwargs['meson_version']:
self.handle_meson_version(kwargs['meson_version'], node)
- mesonlib.project_meson_versions[self.subproject] = kwargs['meson_version']
if os.path.exists(self.option_file):
oi = optinterpreter.OptionInterpreter(self.subproject)
diff --git a/test cases/common/33 run program/meson.build b/test cases/common/33 run program/meson.build
index aa0a1d6..2257d93 100644
--- a/test cases/common/33 run program/meson.build
+++ b/test cases/common/33 run program/meson.build
@@ -1,4 +1,4 @@
-project('run command', version : run_command('get-version.py', check : true).stdout().strip())
+project('run command', version : run_command('get-version.py', check : true).stdout().strip(), meson_version: '>=0.1.0')
if build_machine.system() == 'windows'
c = run_command('cmd', '/c', 'echo', 'hello', check: false)
diff --git a/test cases/common/33 run program/test.json b/test cases/common/33 run program/test.json
new file mode 100644
index 0000000..da8f128
--- /dev/null
+++ b/test cases/common/33 run program/test.json
@@ -0,0 +1,8 @@
+{
+ "stdout": [
+ {
+ "line": "test cases/common/33 run program/meson.build:1: WARNING: Project targets '>=0.1.0' but uses feature introduced in '0.47.0': check arg in run_command.",
+ "comment": "This triggers on line 1 -- the line with the project() function"
+ }
+ ]
+}