aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-12-30 23:04:59 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:19:33 +0100
commitbd8bad46c3fad6e53e259f73408a73eeca920dc7 (patch)
treeb9d676368f645caa0c532067473c0b6485d518a5 /mesonbuild
parent248adbab9ad0775e513b920e9047b2e93664ae2e (diff)
downloadmeson-bd8bad46c3fad6e53e259f73408a73eeca920dc7.zip
meson-bd8bad46c3fad6e53e259f73408a73eeca920dc7.tar.gz
meson-bd8bad46c3fad6e53e259f73408a73eeca920dc7.tar.bz2
Code cleanup and renamed variables
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py5
-rw-r--r--mesonbuild/mintro.py8
2 files changed, 5 insertions, 8 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 23da39e..b7df33a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -343,7 +343,7 @@ int dummy;
lang = comp.get_language()
tgt = self.introspection_data[id]
# Find an existing entry or create a new one
- id_hash = (lang, CompilerArgs)
+ id_hash = (lang, parameters)
src_block = tgt.get(id_hash, None)
if src_block is None:
# Convert parameters
@@ -351,7 +351,7 @@ int dummy;
parameters = parameters.to_native(copy=True)
parameters = comp.compute_parameters_with_absolute_paths(parameters, self.build_dir)
if target.is_cross:
- parameters += comp.get_cross_extra_flags(self.environment, False)
+ parameters.insert(0, comp.get_cross_extra_flags(self.environment, False))
# The new entry
src_block = {
'language': lang,
@@ -360,7 +360,6 @@ int dummy;
'sources': [],
'generated_sources': [],
}
- self._intro_last_index = len(tgt)
tgt[id_hash] = src_block
# Make source files absolute
sources = [x.absolute_path(self.source_dir, self.build_dir) if isinstance(x, File) else os.path.normpath(os.path.join(self.build_dir, x))
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 63cf7fb..cba10f3 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -35,8 +35,6 @@ from .compilers import compilers
import sys, os
import pathlib
-INTROSPECTION_OUTPUT_FILE = 'meson-introspection.json'
-
def add_arguments(parser):
parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
help='List top level targets.')
@@ -62,7 +60,7 @@ def add_arguments(parser):
help='Print all available information.')
parser.add_argument('-i', '--indent', dest='indent', type=int, default=0,
help='Number of spaces used for indentation.')
- parser.add_argument('-f', '--force-dict-output', action='store_true', dest='force_dict', default=False,
+ parser.add_argument('-f', '--force-object-output', action='store_true', dest='force_dict', default=False,
help='Always use the new JSON format for multiple entries (even for 0 and 1 introspection commands)')
parser.add_argument('builddir', nargs='?', default='.', help='The build directory')
@@ -104,7 +102,7 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend)
'type': target.get_typename(),
'filename': fname,
'build_by_default': target.build_by_default,
- 'sources': backend.get_introspection_data(idname, target)
+ 'target_sources': backend.get_introspection_data(idname, target)
}
if installdata and target.should_install():
@@ -276,7 +274,7 @@ def list_target_files(target_name, targets, builddata: build.Build):
print('Target with the ID "{}" could not be found'.format(target_name))
sys.exit(1)
- for i in tgt['sources']:
+ for i in tgt['target_sources']:
result += i['sources'] + i['generated_sources']
# TODO Remove this line in a future PR with other breaking changes