From dda5e8cadbfdeee3267b1a0943c014e06bcd0100 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 25 Sep 2017 13:46:07 -0700 Subject: Allow CustomTarget's to be indexed This allows a CustomTarget to be indexed, and the resulting indexed value (a CustomTargetIndex type), to be used as a source in other targets. This will confer a dependency on the original target, but only inserts the source file returning by index the original target's outputs. This can allow a CustomTarget that creates both a header and a code file to have it's outputs split, for example. Fixes #1470 --- mesonbuild/backend/backends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/backend/backends.py') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 97959b6..12fb3eb 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -174,7 +174,7 @@ class Backend: Returns the full path of the generated source relative to the build root """ # CustomTarget generators output to the build dir of the CustomTarget - if isinstance(gensrc, build.CustomTarget): + if isinstance(gensrc, (build.CustomTarget, build.CustomTargetIndex)): return os.path.join(self.get_target_dir(gensrc), src) # GeneratedList generators output to the private build directory of the # target that the GeneratedList is used in -- cgit v1.1