which target outputs a file

31 views
Skip to first unread message

Erik Smith

unread,
Feb 17, 2023, 9:39:34 AM2/17/23
to gn-dev
Is there a way in GN to determine which target generates an output file?  This would be the opposite of gn outputs. 

David Turner

unread,
Feb 17, 2023, 10:12:11 AM2/17/23
to Erik Smith, gn-dev
On Fri, Feb 17, 2023 at 3:39 PM Erik Smith <cruise...@gmail.com> wrote:
Is there a way in GN to determine which target generates an output file?  This would be the opposite of gn outputs. 

You can use `gn refs` for this by specifying the path of the output directory relative to the source root, for example if your build directory is out/Default (as with Chromium), then:

gn refs out/Default //out/Default/path/to/output/file

Would give you labels for targets that reference this (either as inputs or outputs though, there is no way to distinguish them as far as I know).
 

--
To unsubscribe from this group and stop receiving emails from it, send an email to gn-dev+un...@chromium.org.

Erik Smith

unread,
Feb 17, 2023, 10:32:27 AM2/17/23
to gn-dev, di...@google.com, gn-dev, Erik Smith
Ah it's clear now re-reading the gn refs doc, thanks. 
Reply all
Reply to author
Forward
0 new messages