# Copyright 2020 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.

# DO NOT EDIT. THIS FILE IS GENERATED BY CARGO GNAW. EDIT THE CARGO TOML FILE

import("//build/licenses/license.gni")

gn_source_root = rebase_path("//", root_build_dir)
not_needed([ "gn_source_root" ])

group("a") {
  public_deps = [ ":a-v1_0_0" ]
}

if (!(current_os == "fuchsia")) {
  group("b") {
    public_deps = [ ":b-v1_0_0" ]
  }
}

rust_library("a-v1_0_0") {
  crate_name = "a"
  crate_root = "//platform_features/a/src/lib.rs"
  output_name = "a-537022e729cc9ca0"

  deps = []
  if (!(current_os == "fuchsia")) {
    deps += [ ":b-v1_0_0" ]
  }

  rustenv = []

  rustflags = [
    "--cap-lints=allow",
    "--edition=2021",
    "-Cmetadata=537022e729cc9ca0",
    "-Cextra-filename=-537022e729cc9ca0",
  ]
  if (!(current_os == "fuchsia")) {
    rustflags += [ "--cfg=feature=\"b\"" ]
  }

  visibility = [ ":*" ]

  applicable_licenses = []
}

rust_library("b-v1_0_0") {
  crate_name = "b"
  crate_root = "//platform_features/b/src/lib.rs"
  output_name = "b-72d4e469bdf48536"

  deps = []

  rustenv = []

  rustflags = [
    "--cap-lints=allow",
    "--edition=2021",
    "-Cmetadata=72d4e469bdf48536",
    "-Cextra-filename=-72d4e469bdf48536",
  ]

  visibility = [ ":*" ]

  applicable_licenses = []
}
