aboutsummaryrefslogtreecommitdiff
path: root/mesonintrospect.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-08-12 14:04:41 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-08-12 14:04:41 +0300
commit05d929d542890df227584740cb33fa22334fdb4b (patch)
treed4b73eee0826b570bfd38beacb2dfb8633c96ea8 /mesonintrospect.py
parente3873e89d11aa92c41393d69791e8fc5b24328ce (diff)
downloadmeson-05d929d542890df227584740cb33fa22334fdb4b.zip
meson-05d929d542890df227584740cb33fa22334fdb4b.tar.gz
meson-05d929d542890df227584740cb33fa22334fdb4b.tar.bz2
Fix introspection and make it possible to have top level targets with the same name in subprojects. Fixes #222.
Diffstat (limited to 'mesonintrospect.py')
-rwxr-xr-xmesonintrospect.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonintrospect.py b/mesonintrospect.py
index 5ddc7f5..1c0c7b0 100755
--- a/mesonintrospect.py
+++ b/mesonintrospect.py
@@ -41,9 +41,10 @@ parser.add_argument('args', nargs='+')
def list_targets(coredata, builddata):
tlist = []
- for target in builddata.get_targets().values():
+ for (idname, target) in builddata.get_targets().items():
t = {}
t['name'] = target.get_basename()
+ t['id'] = idname
fname = target.get_filename()
if isinstance(fname, list):
fname = [os.path.join(target.subdir, x) for x in fname]
@@ -78,7 +79,7 @@ def list_target_files(target_name, coredata, builddata):
except KeyError:
print("Unknown target %s." % target_name)
sys.exit(1)
- sources = [os.path.join(subdir, i) for i in sources]
+ sources = [os.path.join(i.subdir, i.fname) for i in sources]
print(json.dumps(sources))
def list_buildoptions(coredata, builddata):