diff --git a/interpreter.py b/interpreter.py index 3da71a1ee..85d472eb1 100644 --- a/interpreter.py +++ b/interpreter.py @@ -872,7 +872,7 @@ class MesonMain(InterpreterObject): self.build.dep_manifest_name = args[0] def project_version_method(self, args, kwargs): - return self.build.dep_manifest[self.interpreter.active_projectname] + return self.build.dep_manifest[self.interpreter.active_projectname]['version'] class Interpreter(): @@ -1377,7 +1377,9 @@ class Interpreter(): self.parse_default_options(kwargs['default_options']) self.active_projectname = args[0] self.project_version = kwargs.get('version', 'undefined') - self.build.dep_manifest[args[0]] = self.project_version + license = mesonlib.stringlistify(kwargs.get('license', 'unknown')) + self.build.dep_manifest[args[0]] = {'version': self.project_version, + 'license': license} if self.subproject in self.build.projects: raise InvalidCode('Second call to project().') if not self.is_subproject() and 'subproject_dir' in kwargs: diff --git a/test cases/common/49 subproject/meson.build b/test cases/common/49 subproject/meson.build index 2616853b5..1e05ddfae 100644 --- a/test cases/common/49 subproject/meson.build +++ b/test cases/common/49 subproject/meson.build @@ -1,4 +1,6 @@ -project('subproj user', 'c', version : '2.3.4') +project('subproj user', 'c', + version : '2.3.4', + license : 'mylicense') sub = subproject('sublib', version : '1.0.0') diff --git a/test cases/common/49 subproject/subprojects/sublib/meson.build b/test cases/common/49 subproject/subprojects/sublib/meson.build index 922c6cfcd..3da031b49 100644 --- a/test cases/common/49 subproject/subprojects/sublib/meson.build +++ b/test cases/common/49 subproject/subprojects/sublib/meson.build @@ -1,4 +1,6 @@ -project('subproject', 'c', version : '1.0.0') +project('subproject', 'c', + version : '1.0.0', + license : ['sublicense1', 'sublicense2']) if not meson.is_subproject() error('Claimed to be master project even though we are a subproject.')