diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-12 10:09:20 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-13 19:04:57 +0100 |
commit | 96f354ebded9268a6fd91ceac4ff56555092251d (patch) | |
tree | abb775d289bfdc7ad03a1639c3afc1848437bb98 | |
parent | 243eca6cee9c84fec96c030c3465ecb85a3f4323 (diff) | |
download | meson-96f354ebded9268a6fd91ceac4ff56555092251d.zip meson-96f354ebded9268a6fd91ceac4ff56555092251d.tar.gz meson-96f354ebded9268a6fd91ceac4ff56555092251d.tar.bz2 |
Load source dir from meson-info.json
-rw-r--r-- | mesonbuild/mintro.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index c6a08bf..45689bd 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -296,7 +296,7 @@ def list_buildoptions_from_source(sourcedir, backend, indent): mlog.enable() print(json.dumps(list_buildoptions(intr.coredata), indent=indent)) -def list_target_files(target_name, targets, builddata: build.Build): +def list_target_files(target_name: str, targets: list, source_dir: str): sys.stderr.write("WARNING: The --target-files introspection API is deprecated. Use --targets instead.\n") result = [] tgt = None @@ -313,7 +313,7 @@ def list_target_files(target_name, targets, builddata: build.Build): for i in tgt['target_sources']: result += i['sources'] + i['generated_sources'] - result = list(map(lambda x: os.path.relpath(x, builddata.environment.get_source_dir()), result)) + result = list(map(lambda x: os.path.relpath(x, source_dir), result)) return result @@ -515,9 +515,11 @@ def run(options): return 1 intro_vers = '0.0.0' + source_dir = None with open(infofile, 'r') as fp: raw = json.load(fp) intro_vers = raw.get('introspection', {}).get('version', {}).get('full', '0.0.0') + source_dir = raw.get('directories', {}).get('source', None) vers_to_check = get_meson_introspection_required_version() for i in vers_to_check: @@ -540,8 +542,7 @@ def run(options): targets_file = os.path.join(infodir, 'intro-targets.json') with open(targets_file, 'r') as fp: targets = json.load(fp) - builddata = build.load(options.builddir) - results += [('target_files', list_target_files(options.target_files, targets, builddata))] + results += [('target_files', list_target_files(options.target_files, targets, source_dir))] # Extract introspection information from JSON for i in toextract: |