blob: 9a19c73d5feb97037fe97edbe3465b24ae3718cd [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"
rebased_binary_manifest = rebase_path(binary_manifest, root_build_dir)
compiled_action(target_name) {
testonly = true
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 = {
# Used by //:prebuilt_binaries target.
prebuilt_binaries = [
{
name = target_name
manifest = rebased_binary_manifest
},
]
# Used by //:debug_symbols taraget.
debug_symbol_manifests = [
{
label = get_label_info(":$target_name", "label_with_toolchain")
manifest = rebased_binary_manifest
},
]
}
}
}