diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2018-11-28 19:40:16 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-06 12:19:28 +0100 |
commit | a5be893b19daf9e1f08eacc5d7f01389f6e40956 (patch) | |
tree | 1497e3a6e6d0d3efc172160f99306852ccc73ca4 /mesonbuild/mintro.py | |
parent | 74274e23ca42260e9be24c3cfaf7550c6c1505d2 (diff) | |
download | meson-a5be893b19daf9e1f08eacc5d7f01389f6e40956.zip meson-a5be893b19daf9e1f08eacc5d7f01389f6e40956.tar.gz meson-a5be893b19daf9e1f08eacc5d7f01389f6e40956.tar.bz2 |
Some code cleanup
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r-- | mesonbuild/mintro.py | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 449220c..6768070 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -104,37 +104,26 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend) if not isinstance(target, build.Target): raise RuntimeError('Something weird happened. File a bug.') - if isinstance(backend, backends.Backend): - sources = backend.get_introspection_data(idname, target) - else: - raise RuntimeError('Parameter backend has an invalid type. This is a bug.') - - t = {'name': target.get_basename(), 'id': idname, 'sources': sources} fname = target.get_filename() if isinstance(fname, list): fname = [os.path.join(target.subdir, x) for x in fname] else: fname = os.path.join(target.subdir, fname) - t['filename'] = fname - if isinstance(target, build.Executable): - typename = 'executable' - elif isinstance(target, build.SharedLibrary): - typename = 'shared library' - elif isinstance(target, build.StaticLibrary): - typename = 'static library' - elif isinstance(target, build.CustomTarget): - typename = 'custom' - elif isinstance(target, build.RunTarget): - typename = 'run' - else: - typename = 'unknown' - t['type'] = typename + + t = { + 'name': target.get_basename(), + 'id': idname, + 'type': target.get_typename(), + 'filename': fname, + 'build_by_default': target.build_by_default, + 'sources': backend.get_introspection_data(idname, target) + } + if installdata and target.should_install(): t['installed'] = True t['install_filename'] = determine_installed_path(target, installdata) else: t['installed'] = False - t['build_by_default'] = target.build_by_default tlist.append(t) return ('targets', tlist) |