0

private_code_test: Add a GN dep only for cross-toolchain deps

GN writes all targets for the default toolchain, so the dep isn't
required there. Removing it makes this build faster.

Bug: 40204298
Change-Id: Iacb4e1fbca2e2781d0e1daae224ad3754c04e71d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6202282
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#1411738}
This commit is contained in:
Andrew Grieve
2025-01-27 10:43:23 -08:00
committed by Chromium LUCI CQ
parent 733255ff48
commit c849cfb8eb

@ -19,8 +19,9 @@ template("private_code_test") {
}
if (shlib_prefix != "") {
_so_name = shlib_prefix + get_label_info(_linker_inputs_dep, "name")
_so_name =
string_replace(_so_name, "${shlib_prefix}${shlib_prefix}", shlib_prefix)
_so_name = string_replace(_so_name,
"${shlib_prefix}${shlib_prefix}",
shlib_prefix)
}
_executable_path = "$_dir/${_so_name}$shlib_extension"
}
@ -36,7 +37,9 @@ template("private_code_test") {
# The script does not read this file, so the dep is not really required.
# It is needed only in the case where the target is in a different
# toolchain, and would not be added to build.ninja otherwise.
deps = [ _linker_inputs_dep ]
if (get_label_info(_linker_inputs_dep, "toolchain") != default_toolchain) {
deps = [ _linker_inputs_dep ]
}
args = [
"--executable",
rebase_path(_executable_path, root_build_dir),