What kind of file in secondary_source will be looked up by GN?

28 views
Skip to first unread message

Shang Yu

unread,
Mar 30, 2025, 11:37:02 PMMar 30
to gn-dev
Hi guys,
I would like to put all my GN files in a secondary_source directory while keeping the root clean from all GN files with the following setup

1. gn gen out/gn -root=/paht/to/root -dotfile=/path/to/build/mydot.gn
2. in mydot.gn, I have the following settings
secondary_source="/path/to/build"
buildconfig="//config.gn"

with this configuration, I can put all GN files in secondary_source and its subdirectories. It works perfectly until I setup an action as follow
action("test") {
  script = "myscript.py"
  ...
}
when building this target, GN complained that it can't find the script. It seems GN will not look up python script in secondary_source. Is this true?

Dirk Pranke

unread,
Mar 31, 2025, 7:46:29 PMMar 31
to Shang Yu, gn-dev
It's been quite some time since I looked at secondary_source, but I believe it just works for finding BUILD files, and not finding files generally. You might have to say something like `script = "/path/to/build/myscript.py"`.

-- Dirk

To unsubscribe from this group and stop receiving emails from it, send an email to gn-dev+un...@chromium.org.
Reply all
Reply to author
Forward
0 new messages