| # Copyright 2026 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/rust/rustc_cdylib.gni") |
| |
| set_defaults("fuchsia_cc_dso") { |
| configs = default_shared_library_configs |
| } |
| |
| set_defaults("fuchsia_rust_dso") { |
| configs = default_shared_library_configs |
| } |
| |
| # TODO(https://fxbug.dev/483772254): Switch these to use loadable_module, like |
| # drivers |
| |
| template("fuchsia_cc_dso") { |
| assert(defined(invoker.async), "async must be set to true or false") |
| if (!defined(invoker.deps)) { |
| invoker.deps = [] |
| } |
| if (invoker.async) { |
| invoker.deps += [ "//src/lib/dso/cpp:async" ] |
| } else { |
| invoker.deps += [ "//src/lib/dso/cpp:sync" ] |
| } |
| shared_library("$target_name") { |
| forward_variables_from(invoker, "*") |
| } |
| } |
| |
| template("fuchsia_rust_dso") { |
| if (!defined(invoker.deps)) { |
| invoker.deps = [] |
| } |
| invoker.deps += [ |
| "//src/lib/fuchsia", |
| "//src/lib/dso/rust", |
| "//sdk/rust/zx", |
| ] |
| rustc_cdylib("$target_name") { |
| forward_variables_from(invoker, "*") |
| } |
| } |