Can check for Meson version in project definition.

pull/282/head
Jussi Pakkanen 9 years ago
parent df979ad422
commit c5788548d2
  1. 5
      interpreter.py
  2. 2
      test cases/common/1 trivial/meson.build
  3. 1
      test cases/failing/20 version/meson.build

@ -1269,6 +1269,11 @@ class Interpreter():
if not self.is_subproject() and 'subproject_dir' in kwargs:
self.subproject_dir = kwargs['subproject_dir']
if 'meson_version' in kwargs:
cv = coredata.version
pv = kwargs['meson_version']
if not mesonlib.version_compare(cv, pv):
raise InterpreterException('Meson version is %s but project requires %s.' % (cv, pv))
self.build.projects[self.subproject] = args[0]
mlog.log('Project name: ', mlog.bold(args[0]), sep='')
self.add_languages(node, args[1:])

@ -1,5 +1,5 @@
# Comment on the first line
project('trivial test', 'c')
project('trivial test', 'c', meson_version : '>=0.27.0')
#this is a comment
sources = 'trivial.c'

@ -0,0 +1 @@
project('version mismatch', 'c', meson_version : '>100.0.0')
Loading…
Cancel
Save