| # 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( |
| "//src/connectivity/network/netstack3/core/rustc_library_with_features.gni") |
| |
| rustc_library_with_features("netstack3-sync") { |
| version = "0.0.1" |
| edition = "2021" |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| check_cfgs = [ "loom" ] |
| sources = [ |
| "src/lib.rs", |
| "src/rc.rs", |
| ] |
| deps = [ |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/network/netstack3/core/lock-order", |
| "//third_party/rust_crates:derivative", |
| ] |
| |
| feature_sets = [ |
| { |
| features = [] |
| with_unit_tests = true |
| }, |
| { |
| target_name = "netstack3-sync-instrumented" |
| features = [ |
| "recursive-lock-panic", |
| "rc-debug-names", |
| ] |
| with_unit_tests = true |
| }, |
| ] |
| if (is_host) { |
| feature_sets += [ |
| { |
| target_name = "netstack3-sync-loom" |
| features = [] |
| deps += [ "//third_party/rust_crates:loom" ] |
| testonly = true |
| configs += [ "//src/connectivity/network/netstack3/core:loom" ] |
| }, |
| ] |
| } |
| } |
| |
| fuchsia_unittest_package("netstack3-sync-instrumented-package") { |
| package_name = "netstack3-sync-instrumented" |
| deps = [ ":netstack3-sync-instrumented_test" ] |
| } |
| |
| fuchsia_unittest_package("netstack3-sync-package") { |
| package_name = "netstack3-sync" |
| deps = [ ":netstack3-sync_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":netstack3-sync($host_toolchain)", |
| ":netstack3-sync-instrumented-package", |
| ":netstack3-sync-instrumented_test($host_toolchain)", |
| ":netstack3-sync-package", |
| ] |
| } |