GN project.json should provide VisualStudioWriter::GetNinjaTarget equivalent. |
||
Issue descriptionFor most target types, the 'outputs' array in the project.json states which ninja targets (as gn labels, root relative) should be built for the given gn target label. However, this is noticeably empty for 'source_set', 'group', and 'bundle_data' target types. In addition, it is somewhat annoying (from the perspective of project.json) that these are given as (root relative) gn labels instead of directly as (build relative) ninja targets (as 'source_outputs' array entries are). These 'outputs' values appear to be useful for extracting build artifacts, but less helpful when deciding what ninja target to run given a gn label. Essentially, the information desired is the same as the msvs ide generator uses from VisualStudioWriter::GetNinjaTarget. For each gn target, simply list the (build relative) ninja target(s) to build. This information answers the question 'if I want to build this label, which ninja target do I build?', which is not always completely obvious. It appears there are at least two ways to do this. The first way is to just lift the restriction on 'outputs' and just write out the target_->dependency_output_file().AsASourceFile as the 'outputs' of 'source_set', 'group', and 'bundle_data' target types. This has the downside that these 'outputs' are not really user defined outputs, changing the meaning of 'outputs'. It also has the downside of needing to list the 'stamp' files as sources, when they really shouldn't ever be considered as such. On the other hand, this is very simple to implement. The second is to add a new 'ninja_target' (name subject to bike shedding) output by TargetDescBuilder which directly has this information and can be requested separately. This is quite similar to 'source_outputs' which could equivalently be named 'source_ninja_targets' from what I can tell. Then 'copy' and 'action_foreach' targets could just list their stamp file in 'ninja_target' and provide 'source_outputs' for their sources (since they are, in effect, their own specialized mini toolchains).
,
Jan 13 2017
I think this sounds reasonable. Please feel free to work on it if you like.
,
Aug 1
|
||
►
Sign in to add a comment |
||
Comment 1 by bunge...@chromium.org
, Dec 1 2016