aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorNiklas Claesson <nicke.claesson@gmail.com>2018-05-01 13:51:55 +0200
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-05-01 11:51:55 +0000
commit4f4cdee6876148b14a430e5886fec45299bb0573 (patch)
treef5dbe7faf3f6eb531f218928447fb250e0805e1f /test cases
parent8c381e1786d0fbeb2136187c6d98f4000e8962bf (diff)
downloadmeson-4f4cdee6876148b14a430e5886fec45299bb0573.zip
meson-4f4cdee6876148b14a430e5886fec45299bb0573.tar.gz
meson-4f4cdee6876148b14a430e5886fec45299bb0573.tar.bz2
Allow custom_target do depend on indexed output of custom_target
Fixes: #3494
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/161 index customtarget/check_args.py18
-rw-r--r--test cases/common/161 index customtarget/meson.build7
2 files changed, 25 insertions, 0 deletions
diff --git a/test cases/common/161 index customtarget/check_args.py b/test cases/common/161 index customtarget/check_args.py
new file mode 100644
index 0000000..8663a6f
--- /dev/null
+++ b/test cases/common/161 index customtarget/check_args.py
@@ -0,0 +1,18 @@
+#!python3
+
+import sys
+from pathlib import Path
+
+def main():
+ if len(sys.argv) != 2:
+ print(sys.argv)
+ return 1
+ if sys.argv[1] != 'gen.c':
+ print(sys.argv)
+ return 2
+ Path('foo').touch()
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/test cases/common/161 index customtarget/meson.build b/test cases/common/161 index customtarget/meson.build
index 11cb214..27d28b5 100644
--- a/test cases/common/161 index customtarget/meson.build
+++ b/test cases/common/161 index customtarget/meson.build
@@ -29,4 +29,11 @@ lib = static_library(
['lib.c', gen[1]],
)
+custom_target(
+ 'foo',
+ input: gen[0],
+ output: 'foo',
+ command: [find_program('check_args.py'), '@INPUT@'],
+)
+
subdir('subdir')