blob: 3ccb28cebd6949550089d31d18d12ab29fd0b951 [file] [log] [blame]
# Copyright 2020 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.
import("//build/compiled_action.gni")
import("//build/toolchain/breakpad.gni")
# Generate a manifest of prebuilt binaries provided in .build-id format.
#
# Parameters
#
# build_id_dir (required)
# Path to the .build-id directory to consume.
template("prebuilt_binaries") {
assert(defined(invoker.build_id_dir), "build_id_dir is required")
binary_manifest = "$target_gen_dir/${target_name}_binaries.json"
compiled_action(target_name) {
testonly = true
# TODO(fxbug.dev/90619): maybe remove the line below.
hermetic_deps = false
tool = "//tools/debug/generate_breakpad"
outputs = [ binary_manifest ]
if (is_linux) {
# The breakpad dumpsyms prebuilt is only available for
# and exercised on Linux at this time.
inputs = [ breakpad_dump_syms_prebuilt ]
}
depfile = "$target_gen_dir/$target_name.d"
args = [
"-build-id-dir-in",
rebase_path(invoker.build_id_dir),
"-build-id-dir-out",
rebase_path("$root_build_dir/.build-id", root_build_dir),
"-cpu",
target_cpu,
"-os",
target_os,
"-output-manifest",
rebase_path(binary_manifest, root_build_dir),
"-dump-syms",
breakpad_dump_syms,
"-depfile",
rebase_path(depfile, root_build_dir),
]
metadata = {
prebuilt_binaries = [
{
name = target_name
manifest = rebase_path(binary_manifest, root_build_dir)
},
]
}
}
}