1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# @generated from third_party/rust/chromium_crates_io/BUILD.gn.hbs by
# tools/crates/gnrt.
# Do not edit!
import("//build/rust/cargo_crate.gni")
{{#each rules}}
cargo_crate("{{this.name}}") {
{{#with this.detail}}
{{#if crate_name}}
crate_name = "{{crate_name}}"
{{/if}}
{{#if epoch}}
epoch = "{{epoch}}"
{{/if}}
crate_type = "{{crate_type}}"
crate_root = "{{crate_root}}"
sources = [
{{#each sources}}
"{{this}}",
{{/each}}
]
inputs = [
{{#each inputs}}
"{{this}}",
{{/each}}
]
build_native_rust_unit_tests = false
edition = "{{edition}}"
cargo_pkg_version = "{{cargo_pkg_version}}"
{{#with cargo_pkg_authors}}
cargo_pkg_authors = "{{gn_escape this}}"
{{/with}}
cargo_pkg_name = "{{cargo_pkg_name}}"
{{#with cargo_pkg_description}}
cargo_pkg_description = "{{gn_escape this}}"
{{/with}}
library_configs -= [ "//build/config/coverage:default_coverage" ]
library_configs -= [ "//build/config/compiler:chromium_code" ]
library_configs += [ "//build/config/compiler:no_chromium_code" ]
executable_configs -= [ "//build/config/compiler:chromium_code" ]
executable_configs += [ "//build/config/compiler:no_chromium_code" ]
proc_macro_configs -= [ "//build/config/compiler:chromium_code" ]
proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ]
{{#each deps}}
{{#if @first}}
deps = [
{{#if ../dep_on_lib}}
":lib",
{{/if}}
{{#each this.packages}}
"//third_party/rust/{{this.name}}/{{this.epoch}}:lib",
{{/each}}
]
{{else}}
if ({{this.cond}}) {
deps += [
{{#each this.packages}}
"//third_party/rust/{{this.name}}/{{this.epoch}}:lib",
{{/each}}
]
}
{{/if}}
{{/each}}
{{#if aliased_deps}}
aliased_deps = {
{{#each aliased_deps}}
{{this.0}} = "{{this.1}}"
{{/each}}
}
{{/if}}
{{#each build_deps}}
{{#if @first}}
build_deps = [
{{#each this.packages}}
"//third_party/rust/{{this.name}}/{{this.epoch}}:buildrs_support",
{{/each}}
]
{{else}}
if ({{this.cond}}) {
build_deps += [
{{#each this.packages}}
"//third_party/rust/{{this.name}}/{{this.epoch}}:buildrs_support",
{{/each}}
]
}
{{/if}}
{{/each}}
{{#if features}}
features = [
{{#each features}}
"{{this}}",
{{/each}}
]
{{/if}}
{{#if build_root}}
build_root = "{{build_root}}"
build_sources = [
{{#each build_script_sources}}
"{{this}}",
{{/each}}
]
{{#with build_script_inputs}}
build_script_inputs = [
{{#each this}}
"{{this}}",
{{/each}}
]
{{/with}}
{{#with build_script_outputs}}
build_script_outputs = [
{{#each this}}
"{{this}}",
{{/each}}
]
{{/with}}
{{/if}}
{{#with extra_kv.configs_to_remove}}
{{#each this}}
library_configs -= [ "{{this}}" ]
executable_configs -= [ "{{this}}" ]
proc_macro_configs -= [ "{{this}}" ]
{{/each}}
{{/with}}
{{#with extra_kv.configs_to_add}}
{{#each this}}
library_configs += [ "{{this}}" ]
executable_configs += [ "{{this}}" ]
proc_macro_configs += [ "{{this}}" ]
{{/each}}
{{/with}}
rustflags = [
"--cap-lints=allow", # Suppress all warnings in crates.io crates
]
{{#if output_dir}}
output_dir = "{{output_dir}}"
{{/if}}
{{#if native_libs}}
native_libs = [
{{#each native_libs}}
"{{this}}",
{{/each}}
]
{{/if}}
{{/with}}
{{#if gn_visibility.public}}
{{#if detail.extra_kv.visibility}}
visibility = []
{{/if}}
{{else}}
# Only for usage from third-party crates. Add the crate to
# //third_party/rust/chromium_crates_io/Cargo.toml to use
# it from first-party code.
visibility = [ "//third_party/rust/*" ]
{{/if}}
{{#each detail.extra_kv.visibility}}
visibility += [ "{{this}}" ]
{{/each}}
{{#if gn_visibility.testonly}}
testonly = true
{{/if}}
}
{{/each}}
|