aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/IDE-integration.md4
-rw-r--r--docs/markdown/snippets/introspect_multiple.md2
-rw-r--r--mesonbuild/backend/ninjabackend.py5
-rw-r--r--mesonbuild/mintro.py8
-rwxr-xr-xrun_unittests.py4
5 files changed, 10 insertions, 13 deletions
diff --git a/docs/markdown/IDE-integration.md b/docs/markdown/IDE-integration.md
index 81fd43f..d4554ae 100644
--- a/docs/markdown/IDE-integration.md
+++ b/docs/markdown/IDE-integration.md
@@ -40,7 +40,7 @@ The most important file for an IDE is probably `intro-targets.json`. Here each t
"type": "<TYPE>",
"filename": ["list", "of", "generated", "files"],
"build_by_default": true / false,
- "sources": [],
+ "target_sources": [],
"installed": true / false,
}
```
@@ -51,7 +51,7 @@ A target usually generates only one file. However, it is possible for custom tar
### Target sources
-The `intro-sources.json` file stores a list of all source objects of the target. With this information, an IDE can provide code completion for all source files.
+The `intro-targets.json` file also stores a list of all source objects of the target in the `target_sources`. With this information, an IDE can provide code completion for all source files.
```json
{
diff --git a/docs/markdown/snippets/introspect_multiple.md b/docs/markdown/snippets/introspect_multiple.md
index 3bbe6cc..0d53d48 100644
--- a/docs/markdown/snippets/introspect_multiple.md
+++ b/docs/markdown/snippets/introspect_multiple.md
@@ -7,7 +7,7 @@ object.
The format for a single command was not changed to keep backward
compatibility.
-Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-dict-output`
+Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-object-output`
were added to print all introspection information in one go, format the
JSON output (the default is still compact JSON) and force use the new
output format, even if only one introspection command was given.
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
diff --git a/run_unittests.py b/run_unittests.py
index 4b4d86b..f7737ab 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3182,7 +3182,7 @@ recommended as it is not supported on some platforms''')
('type', str),
('filename', str),
('build_by_default', bool),
- ('sources', list),
+ ('target_sources', list),
('installed', bool),
]
@@ -3260,7 +3260,7 @@ recommended as it is not supported on some platforms''')
self.assertEqual(i['build_by_default'], tgt[1])
self.assertEqual(i['installed'], tgt[2])
targets_to_find.pop(i['name'], None)
- for j in i['sources']:
+ for j in i['target_sources']:
assertKeyTypes(targets_sources_typelist, j)
self.assertDictEqual(targets_to_find, {})