| # Copyright 2024 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| declare_args() { |
| # Use the prebuilt buildidtool binary rather than one built locally. |
| # **NOTE:** Setting this to `false` uses the `toolchain_deps` mechanism in |
| # GN, which can slow down Ninja significantly. Also, to circular deps the |
| # $host_toolchain has no `toolchain_deps` and so doesn't ensure the |
| # buildidtool is built before it's needed. This may make builds unreliable, |
| # but it should be possible to iterate on incremental builds and get the new |
| # tool in place eventually. This should only be used during active |
| # development of buildidtool itself. |
| # |
| # Note, this never applies to Go builds because of the circularity of using |
| # buildidtool in the build of buildidtool. |
| use_prebuilt_buildidtool = true |
| } |
| |
| _prebuilt_buildidtool = |
| "//prebuilt/tools/buildidtool/${host_platform}/buildidtool" |
| |
| _buildidtool_label = "//tools/debug/buildidtool($host_toolchain)" |
| _buildidtool_out_dir = get_label_info(_buildidtool_label, "root_out_dir") |
| _local_buildidtool = "$_buildidtool_out_dir/buildidtool" |
| |
| if (use_prebuilt_buildidtool) { |
| buildidtool_path = _prebuilt_buildidtool |
| buildidtool_toolchain_deps = [] |
| } else { |
| buildidtool_path = _local_buildidtool |
| buildidtool_toolchain_deps = [ _buildidtool_label ] |
| } |
| |
| buildidtool_invocation_path = rebase_path(buildidtool_path, root_build_dir) |