From b434fcd12b59f10f7623d27eafa8ac48c7d051f3 Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Sun, 19 Mar 2017 23:28:05 +0100 Subject: vs: support Generator outputs as CustomTarget inputs This changes how generated files are added to the VS project. Previously, they were all added as a single CustomBuildStep with all generator commands, inputs and outputs merged together. Now, each input file is added separately to the project and is given a CustomBuild command. This adds all generator input files to the files list in the VS gui and allows to run only some of the generator commands if only some of the input files have changed. --- mesonbuild/build.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mesonbuild/build.py') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index bf692e1..c7e8f8e 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1277,7 +1277,7 @@ class CustomTarget(Target): for c in self.sources: if hasattr(c, 'held_object'): c = c.held_object - if isinstance(c, (BuildTarget, CustomTarget, GeneratedList)): + if isinstance(c, (BuildTarget, CustomTarget)): deps.append(c) return deps @@ -1402,8 +1402,17 @@ class CustomTarget(Target): def get_sources(self): return self.sources + def get_generated_lists(self): + genlists = [] + for c in self.sources: + if hasattr(c, 'held_object'): + c = c.held_object + if isinstance(c, GeneratedList): + genlists.append(c) + return genlists + def get_generated_sources(self): - return [] + return self.get_generated_lists() def type_suffix(self): return "@cus" -- cgit v1.1