| # 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. |
| |
| load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS") |
| load("//build/bazel/rules/rust:defs.bzl", "rustc_proc_macro") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| rustc_proc_macro( |
| name = "config-proc-macros", |
| srcs = ["src/lib.rs"], |
| # NOTE: Setting both `compile_data` and `data` is unnecessary in Bazel. |
| # Here we do it so the synced target in GN is still correct. |
| compile_data = [ |
| "//src/developer/ffx:ffx-defaults.json", # @bazel2gn:path_overwrite:${config_path} |
| ], |
| crate_name = "config_proc_macros", |
| data = [ |
| "//src/developer/ffx:ffx-defaults.json", |
| ], |
| edition = "2024", |
| proc_macro_deps = [ |
| "//src/lib/include_str_from_working_dir:include_str_from_working_dir", |
| ], |
| rustc_env = { |
| "FFX_DEFAULT_CONFIG_JSON": "$(location //src/developer/ffx:ffx-defaults.json)", # @bazel2gn:value_overwrite:${rebased_config_path} |
| }, |
| target_compatible_with = HOST_CONSTRAINTS, |
| deps = [ |
| "//third_party/rust_crates/vendor:proc-macro2", |
| "//third_party/rust_crates/vendor:quote", |
| "//third_party/rust_crates/vendor:serde_json", |
| "//third_party/rust_crates/vendor:syn", |
| ], |
| ) |