aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-07-27 15:26:02 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-09-24 10:36:05 -0700
commitd661a0cd96e2453e8e4629c867589657b81239d1 (patch)
treedfe6acbb7a20b0f2a43e334470a311aa8f754122 /mesonbuild/backend/backends.py
parent6c5bfd4c241e94f5e0f4dea9ba7fb5d5090a4802 (diff)
downloadmeson-d661a0cd96e2453e8e4629c867589657b81239d1.zip
meson-d661a0cd96e2453e8e4629c867589657b81239d1.tar.gz
meson-d661a0cd96e2453e8e4629c867589657b81239d1.tar.bz2
build: use an object rather than a dict for the dep_manifest
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 4570b00..bc2b74a 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1144,7 +1144,8 @@ class Backend:
ifilename = os.path.join(self.environment.get_build_dir(), 'depmf.json')
ofilename = os.path.join(self.environment.get_prefix(), self.build.dep_manifest_name)
out_name = os.path.join('{prefix}', self.build.dep_manifest_name)
- mfobj = {'type': 'dependency manifest', 'version': '1.0', 'projects': self.build.dep_manifest}
+ mfobj = {'type': 'dependency manifest', 'version': '1.0',
+ 'projects': {k: v.to_json() for k, v in self.build.dep_manifest.items()}}
with open(ifilename, 'w', encoding='utf-8') as f:
f.write(json.dumps(mfobj))
# Copy file from, to, and with mode unchanged