diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2017-03-19 23:28:05 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2017-03-20 14:33:44 +0100 |
commit | b434fcd12b59f10f7623d27eafa8ac48c7d051f3 (patch) | |
tree | 6a7b3b1def4e44b688814b49fbfab231ade30bff /mesonbuild/build.py | |
parent | 59984f501412cb2c8b8643a6b5ee4933c891d99e (diff) | |
download | meson-b434fcd12b59f10f7623d27eafa8ac48c7d051f3.zip meson-b434fcd12b59f10f7623d27eafa8ac48c7d051f3.tar.gz meson-b434fcd12b59f10f7623d27eafa8ac48c7d051f3.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 13 |
1 files changed, 11 insertions, 2 deletions
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" |