blob: 4217c632e9a9cecf8fc09f1854ba88530d065417 [file] [edit]
# 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/components.gni")
import("//build/config/compilation_modes.gni")
import("//build/dist/renamed_binary.gni")
###############################################################################
# GROUPS
###############################################################################
group("forensics") {
testonly = true
deps = [
":pkg",
":tests",
"crasher",
"snapshot",
]
}
group("tests") {
testonly = true
deps = [
"crash_reports/tests",
"exceptions/tests",
"feedback:tests",
"feedback_data/system_log_recorder/tests",
"feedback_data/tests",
"last_reboot/tests",
"snapshot/tests",
"utils/redact/tests",
"utils/tests",
]
}
###############################################################################
# PACKAGES
###############################################################################
fuchsia_package("pkg") {
package_name = "forensics"
deps = [
":compilation_mode_resource",
":exceptions",
":feedback",
]
}
###############################################################################
# COMPONENTS
###############################################################################
fuchsia_component_manifest("exceptions_manifest") {
component_name = "exceptions"
manifest = "exceptions/meta/exceptions.cml"
}
fuchsia_component("exceptions") {
cm_label = ":exceptions_manifest"
deps = [
":exception_handler_exe",
":exceptions_exe",
]
}
fuchsia_component("feedback") {
manifest = "feedback/meta/feedback.cml"
deps = [
":feedback_default_snapshot_config",
":feedback_exe",
":system_log_recorder_exe",
]
}
###############################################################################
# EXECUTABLES
###############################################################################
executable("unified_binary") {
sources = [ "unified_binary.cc" ]
deps = [
":exceptions_config",
"exceptions:main",
"exceptions/handler:main",
"feedback:main",
"feedback_data/system_log_recorder:main",
"//sdk/lib/syslog/cpp",
]
}
renamed_binary("exceptions_exe") {
dest = "bin/exceptions"
source = "$root_out_dir/unified_binary"
source_deps = [ ":unified_binary" ]
}
renamed_binary("exception_handler_exe") {
dest = "bin/exception_handler"
source = "$root_out_dir/unified_binary"
source_deps = [ ":unified_binary" ]
}
renamed_binary("feedback_exe") {
dest = "bin/feedback"
source = "$root_out_dir/unified_binary"
source_deps = [ ":unified_binary" ]
}
renamed_binary("system_log_recorder_exe") {
dest = "bin/system_log_recorder"
source = "$root_out_dir/unified_binary"
source_deps = [ ":unified_binary" ]
}
###############################################################################
# CONFIGS
###############################################################################
resource("feedback_default_snapshot_config") {
sources = [ "feedback/configs/snapshot/default.json" ]
outputs = [ "data/snapshot/default_config.json" ]
}
fuchsia_structured_config_cpp_elf_lib("exceptions_config") {
cm_label = ":exceptions_manifest"
}
generated_file("compilation_mode") {
outputs = [ "${target_out_dir}/build_compilation_mode.txt" ]
contents = compilation_mode
visibility = [ ":*" ]
}
resource("compilation_mode_resource") {
sources = get_target_outputs(":compilation_mode")
outputs = [ "data/build_compilation_mode.txt" ]
deps = [ ":compilation_mode" ]
visibility = [ ":*" ]
}