Then after `gn gen`, and even before building, you can look at
$BUILD_DIR/toolchain_args.json (for the default toolchain) or
$BUILD_DIR/<toolchain_name>/toolchain_args.json (for other toolchains)
Another useful thing we do in the Fuchsia build is write the expanded content of
args.gn into a JSON file as well, with something that looks like:
if (current_toolchain == default_toolchain) {
generated_file("args_json") {
outputs = [ "args.json" ]
content = read_file("$root_build_dir/args.gn", "scope") output_conversion = "json"
This only exports the variables defined in
args.gn (and the file it imports), but is useful for our infra scripts.
Hope this helps,
- Digit