summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-08-09 02:15:27 +0200
committerBert Belder <bertbelder@gmail.com>2018-08-09 02:20:32 +0200
commit69ee336840209b06b35a8393c0abe705aaf5cc11 (patch)
treec63a4b335d46ecaf6c948c40dc83fbbe2af9952d
parent15146ad8866d2af7f6e53570d3f12b76f2c13b86 (diff)
Remove the 'cfg' variable from rust templates
It's never been used for anything other than enabling crate features. Use the 'features' variable instead, it's more readable and more terse.
-rw-r--r--build_extra/rust/BUILD.gn12
-rw-r--r--build_extra/rust/rust.gni11
2 files changed, 6 insertions, 17 deletions
diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn
index b529f2f5a..e3fc6db5f 100644
--- a/build_extra/rust/BUILD.gn
+++ b/build_extra/rust/BUILD.gn
@@ -187,9 +187,9 @@ rust_component("ws2_32") {
rust_component("futures") {
source_root = "$registry_github/futures-0.1.23/src/lib.rs"
- cfg = [
- "feature=\"use_std\"",
- "feature=\"with-deprecated\"",
+ features = [
+ "use_std",
+ "with-deprecated",
]
}
@@ -298,6 +298,7 @@ rust_component("crossbeam_deque") {
rust_component("crossbeam_epoch") {
source_root = "$registry_github/crossbeam-epoch-0.5.1/src/lib.rs"
+ features = [ "use_std" ]
extern = [
":arrayvec",
":cfg_if",
@@ -306,13 +307,12 @@ rust_component("crossbeam_epoch") {
":memoffset",
":scopeguard",
]
- cfg = [ "feature=\"use_std\"" ]
}
rust_component("crossbeam_utils") {
source_root = "$registry_github/crossbeam-utils-0.4.1/src/lib.rs"
+ features = [ "use_std" ]
extern = [ ":cfg_if" ]
- cfg = [ "feature=\"use_std\"" ]
}
rust_component("arrayvec") {
@@ -334,7 +334,7 @@ rust_component("memoffset") {
rust_component("scopeguard") {
source_root = "$registry_github/scopeguard-0.3.3/src/lib.rs"
- cfg = [ "feature=\"use_std\"" ]
+ features = [ "use_std" ]
}
rust_component("num_cpus") {
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni
index 21b397282..8f63bcc08 100644
--- a/build_extra/rust/rust.gni
+++ b/build_extra/rust/rust.gni
@@ -40,7 +40,6 @@ template("run_rustc") {
assert(defined(invoker.source_root), "Must specify source_root")
forward_variables_from(invoker,
[
- "cfg",
"crate_name",
"crate_type",
"crate_version",
@@ -123,15 +122,6 @@ template("run_rustc") {
args += [ "--test" ]
}
- if (defined(cfg)) {
- foreach(c, cfg) {
- args += [
- "--cfg",
- c,
- ]
- }
- }
-
if (defined(features)) {
foreach(f, features) {
args += [
@@ -210,7 +200,6 @@ template("rust_component") {
forward_variables_from(invoker,
[
"args",
- "cfg",
"crate_version",
"deps",
"extern",