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