aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2018-11-29 14:53:28 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-06 12:19:29 +0100
commitb034f52656c19f378fc144abd9087e7526b1e27f (patch)
tree229eed798976f71a29585be161ffe8bc57a83973
parentb91c5aad854bff3a13c27aa1a6ade85ded216207 (diff)
downloadmeson-b034f52656c19f378fc144abd9087e7526b1e27f.zip
meson-b034f52656c19f378fc144abd9087e7526b1e27f.tar.gz
meson-b034f52656c19f378fc144abd9087e7526b1e27f.tar.bz2
Filenames are now lists
-rw-r--r--docs/markdown/snippets/introspect_multiple.md7
-rw-r--r--mesonbuild/build.py3
-rw-r--r--mesonbuild/mintro.py6
-rwxr-xr-xrun_unittests.py6
4 files changed, 13 insertions, 9 deletions
diff --git a/docs/markdown/snippets/introspect_multiple.md b/docs/markdown/snippets/introspect_multiple.md
index d05eae6..17d0a3f 100644
--- a/docs/markdown/snippets/introspect_multiple.md
+++ b/docs/markdown/snippets/introspect_multiple.md
@@ -10,4 +10,9 @@ compatibility.
Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-new`
were added to print all introspection information in one go, format the
JSON output (the default is still compact JSON) and foce use the new
-output format, even if only one introspection command was given. \ No newline at end of file
+output format, even if only one introspection command was given.
+
+Additionlly the format of target was changed:
+ - `filename` is now a list of output filenames
+ - `install_filename` is now also a list of installed files
+ - New: the `sources` key. It stores the source files of a target and there compiler parameters
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 4fa6bde..642c2d5 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -2120,6 +2120,9 @@ class RunTarget(Target):
def get_filename(self):
return self.name
+ def get_outputs(self):
+ return [self.name]
+
def type_suffix(self):
return "@run"
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 04850c6..cf1aeff 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -93,11 +93,7 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend)
if not isinstance(target, build.Target):
raise RuntimeError('Something weird happened. File a bug.')
- 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)
+ fname = [os.path.join(target.subdir, x) for x in target.get_outputs()]
t = {
'name': target.get_basename(),
diff --git a/run_unittests.py b/run_unittests.py
index 492a22c..1977fe0 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1436,7 +1436,7 @@ class AllPlatformTests(BasePlatformTests):
# Get name of static library
targets = self.introspect('--targets')
self.assertEqual(len(targets), 1)
- libname = targets[0]['filename']
+ libname = targets[0]['filename'][0]
# Build and get contents of static library
self.build()
before = self._run(['ar', 't', os.path.join(self.builddir, libname)]).split()
@@ -3168,7 +3168,7 @@ recommended as it is not supported on some platforms''')
('name', str),
('id', str),
('type', str),
- ('filename', str),
+ ('filename', list),
('build_by_default', bool),
('sources', list),
('installed', bool),
@@ -4368,7 +4368,7 @@ class LinuxlikeTests(BasePlatformTests):
break
self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
- self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile))
+ self.assertListEqual(t['filename'], ['gdbus/generated-gdbus-doc-' + os.path.basename(ifile)])
def test_build_rpath(self):
if is_cygwin():