| # Copyright 2022 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/rust/rustc_binary.gni") |
| |
| # Declare an inferior with a default manifest. |
| template("inferior") { |
| _target_name = target_name |
| _target_bin = target_name + "_bin" |
| _target_manifest = target_name + "_manifest" |
| |
| _type = "executable" |
| if (defined(invoker.type)) { |
| _type = invoker.type |
| } |
| |
| target(_type, _target_bin) { |
| output_name = _target_name |
| forward_variables_from(invoker, "*") |
| } |
| |
| generated_file(_target_manifest) { |
| outputs = [ "$target_gen_dir/$_target_manifest.cml" ] |
| output_conversion = "json" |
| contents = { |
| include = [ "syslog/client.shard.cml" ] |
| program = { |
| runner = "elf" |
| binary = "bin/$_target_name" |
| } |
| } |
| } |
| |
| fuchsia_component(target_name) { |
| manifest = "$target_gen_dir/$_target_manifest.cml" |
| deps = [ |
| ":$_target_bin", |
| ":$_target_manifest", |
| ] |
| } |
| } |
| |
| inferior("step_plt") { |
| sources = [ "step_plt.cc" ] |
| cflags = [ "-finline-functions" ] # inline std::make_shared. |
| } |
| |
| inferior("wait_for_debugger") { |
| sources = [ "wait_for_debugger.cc" ] |
| deps = [ "//src/lib/debug" ] |
| } |
| |
| inferior("inlined_crasher") { |
| sources = [ "inlined_crasher.cc" ] |
| } |
| |
| inferior("loop") { |
| sources = [ "loop.cc" ] |
| |
| # Ensure std::ostream << doesn't get inlined. |
| cflags = [ "-fno-inline-functions" ] |
| } |
| |
| inferior("async_rust") { |
| type = "rustc_binary" |
| edition = "2021" |
| sources = [ "async_rust.rs" ] |
| source_root = "async_rust.rs" |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| fuchsia_package("zxdb_e2e_inferiors") { |
| deps = [ |
| ":async_rust", |
| ":inlined_crasher", |
| ":loop", |
| ":step_plt", |
| ":wait_for_debugger", |
| ] |
| } |