| # Copyright 2023 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_macro.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| rustc_macro("netstack3-macros") { |
| source_root = "src/lib.rs" |
| version = "0.1.0" |
| edition = "2021" |
| deps = [ |
| "//third_party/rust_crates:quote", |
| |
| # FIXME(https://fxbug.dev/332277415): Please update to syn 2.x. |
| # "//third_party/rust_crates:syn", |
| "//third_party/rust_crates:syn-v1_0_98", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| if (is_host) { |
| # We only need to run this test on host, so only define it on host. |
| rustc_test("netstack3-macros-test") { |
| source_root = "src/test.rs" |
| version = "0.1.0" |
| edition = "2021" |
| deps = [ |
| ":netstack3-macros", |
| "//src/connectivity/lib/net-types", |
| ] |
| |
| sources = [ "src/test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":netstack3-macros-test($host_toolchain)" ] |
| } |