diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-07-26 11:19:47 +0400 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-07-27 11:26:05 -0700 |
commit | 23ea9feee3f94673c0042527dcd7e98013f1651a (patch) | |
tree | c56d9ef8bbe3c1ccb37baa1356f0b8010548cc2e | |
parent | 46380b5b1e82a5c2b49299eb35ac185d4fa02e18 (diff) | |
download | meson-23ea9feee3f94673c0042527dcd7e98013f1651a.zip meson-23ea9feee3f94673c0042527dcd7e98013f1651a.tar.gz meson-23ea9feee3f94673c0042527dcd7e98013f1651a.tar.bz2 |
build: learn to take CustomTargetIndex as custom_target command
Fix ERROR: Argument <CustomTargetIndex:...>[0]> in "command" is invalid.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r-- | mesonbuild/build.py | 4 | ||||
-rw-r--r-- | test cases/common/49 custom target/meson.build | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index d72aab8..8e0d81b 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2186,6 +2186,10 @@ class CommandBase: elif isinstance(c, (BuildTarget, CustomTarget)): self.dependencies.append(c) final_cmd.append(c) + elif isinstance(c, CustomTargetIndex): + FeatureNew.single_use('CustomTargetIndex for command argument', '0.60', self.subproject) + self.dependencies.append(c.target) + final_cmd += self.flatten_command(File.from_built_file(c.get_subdir(), c.get_filename())) elif isinstance(c, list): final_cmd += self.flatten_command(c) else: diff --git a/test cases/common/49 custom target/meson.build b/test cases/common/49 custom target/meson.build index 52e8630..8e3c9c6 100644 --- a/test cases/common/49 custom target/meson.build +++ b/test cases/common/49 custom target/meson.build @@ -46,6 +46,12 @@ endif assert(mytarget_disabled, 'Disabled custom target should not be found.') +mytarget_ci = custom_target('bindat_ci', +output : 'data_ci.dat', +input : 'data_source.txt', +command : [python, comp, '--input=@INPUT@', '--output=@OUTPUT@', mytarget.to_list()], +) + mytarget_disabler = custom_target('bindat', output : 'data.dat', input : disabler(), |