diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-09-25 13:46:07 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-09-27 22:01:24 +0300 |
commit | dda5e8cadbfdeee3267b1a0943c014e06bcd0100 (patch) | |
tree | 049a70c550729d722e23c67d8312c2eaa820da6f /mesonbuild/backend/vs2010backend.py | |
parent | dfc2b75ee2dba3245ac23bb3d7f0156e47773ed5 (diff) | |
download | meson-dda5e8cadbfdeee3267b1a0943c014e06bcd0100.zip meson-dda5e8cadbfdeee3267b1a0943c014e06bcd0100.tar.gz meson-dda5e8cadbfdeee3267b1a0943c014e06bcd0100.tar.bz2 |
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
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 22c1779..cb8dad6 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -91,7 +91,7 @@ class Vs2010Backend(backends.Backend): source_target_dir = self.get_target_source_dir(target) down = self.target_to_build_root(target) for genlist in target.get_generated_sources(): - if isinstance(genlist, build.CustomTarget): + if isinstance(genlist, (build.CustomTarget, build.CustomTargetIndex)): for i in genlist.get_outputs(): # Path to the generated source from the current vcxproj dir via the build root ipath = os.path.join(down, self.get_target_dir(genlist), i) @@ -201,6 +201,8 @@ class Vs2010Backend(backends.Backend): for gendep in target.get_generated_sources(): if isinstance(gendep, build.CustomTarget): all_deps[gendep.get_id()] = gendep + elif isinstance(gendep, build.CustomTargetIndex): + all_deps[gendep.target.get_id()] = gendep.target else: gen_exe = gendep.generator.get_exe() if isinstance(gen_exe, build.Executable): |