-
Notifications
You must be signed in to change notification settings - Fork 877
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeHealth][rust] Brave
BUILD.gn
handlebars changes
This change contains the handlebars changes we apply to our own handlebars file. This commit also adds a patch that can be used to update the handlebar files, based on new upstream additions.
- Loading branch information
1 parent
f2a3dbf
commit c991329
Showing
2 changed files
with
134 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
diff --git a/third_party/rust/chromium_crates_io/BUILD.gn.hbs b/third_party/rust/chromium_crates_io/BUILD.gn.hbs | ||
index 4cf2f4f5f8b..aa598c2dcf1 100644 | ||
--- a/third_party/rust/chromium_crates_io/BUILD.gn.hbs | ||
+++ b/third_party/rust/chromium_crates_io/BUILD.gn.hbs | ||
@@ -1,6 +1,7 @@ | ||
-# 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. | ||
+# Copyright (c) 2024 The Brave Authors. All rights reserved. | ||
+# This Source Code Form is subject to the terms of the Mozilla Public | ||
+# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
+# You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
# @generated from third_party/rust/chromium_crates_io/BUILD.gn.hbs by | ||
# tools/crates/gnrt. | ||
@@ -53,14 +54,14 @@ cargo_crate("{{this.name}}") { | ||
":lib", | ||
{{/if}} | ||
{{#each this.packages}} | ||
- "//third_party/rust/{{this.name}}/{{this.epoch}}:lib", | ||
+ "//brave/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", | ||
+ "//brave/third_party/rust/{{this.name}}/{{this.epoch}}:lib", | ||
{{/each}} | ||
] | ||
} | ||
@@ -69,7 +70,7 @@ cargo_crate("{{this.name}}") { | ||
{{#if aliased_deps}} | ||
aliased_deps = { | ||
{{#each aliased_deps}} | ||
- {{this.0}} = "{{this.1}}" | ||
+ {{this.0}} = "//brave/third_party/rust/{{this.1}}:lib" | ||
{{/each}} | ||
} | ||
{{/if}} | ||
@@ -77,14 +78,14 @@ cargo_crate("{{this.name}}") { | ||
{{#if @first}} | ||
build_deps = [ | ||
{{#each this.packages}} | ||
- "//third_party/rust/{{this.name}}/{{this.epoch}}:buildrs_support", | ||
+ "//brave/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", | ||
+ "//brave/third_party/rust/{{this.name}}/{{this.epoch}}:buildrs_support", | ||
{{/each}} | ||
] | ||
} | ||
@@ -119,23 +120,32 @@ cargo_crate("{{this.name}}") { | ||
] | ||
{{/with}} | ||
{{/if}} | ||
- {{#if rustenv}} | ||
+ {{#if (or rustenv extra_kv.rustenv)}} | ||
rustenv = [ | ||
{{#each rustenv}} | ||
"{{this}}", | ||
{{/each}} | ||
+ {{#each extra_kv.rustenv}} | ||
+ "{{this}}", | ||
+ {{/each}} | ||
] | ||
{{/if}} | ||
- {{#if rustflags}} | ||
+ {{#if (or rustflags extra_kv.rustflags)}} | ||
rustflags = [ | ||
{{#each rustflags}} | ||
"{{this}}", | ||
{{/each}} | ||
+ {{#each extra_kv.rustflags}} | ||
+ "{{this}}", | ||
+ {{/each}} | ||
] | ||
{{/if}} | ||
{{#if output_dir}} | ||
output_dir = "{{output_dir}}" | ||
{{/if}} | ||
+ {{#if extra_kv.raw_gn}} | ||
+ {{extra_kv.raw_gn}} | ||
+ {{/if}} | ||
{{#if native_libs}} | ||
native_libs = [ | ||
{{#each native_libs}} | ||
@@ -144,20 +154,6 @@ cargo_crate("{{this.name}}") { | ||
] | ||
{{/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}} |