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.
This commit is contained in:
Bert Belder 2018-08-09 02:15:27 +02:00
parent 15146ad886
commit 69ee336840
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
2 changed files with 6 additions and 17 deletions

View file

@ -187,9 +187,9 @@ rust_component("ws2_32") {
rust_component("futures") { rust_component("futures") {
source_root = "$registry_github/futures-0.1.23/src/lib.rs" source_root = "$registry_github/futures-0.1.23/src/lib.rs"
cfg = [ features = [
"feature=\"use_std\"", "use_std",
"feature=\"with-deprecated\"", "with-deprecated",
] ]
} }
@ -298,6 +298,7 @@ rust_component("crossbeam_deque") {
rust_component("crossbeam_epoch") { rust_component("crossbeam_epoch") {
source_root = "$registry_github/crossbeam-epoch-0.5.1/src/lib.rs" source_root = "$registry_github/crossbeam-epoch-0.5.1/src/lib.rs"
features = [ "use_std" ]
extern = [ extern = [
":arrayvec", ":arrayvec",
":cfg_if", ":cfg_if",
@ -306,13 +307,12 @@ rust_component("crossbeam_epoch") {
":memoffset", ":memoffset",
":scopeguard", ":scopeguard",
] ]
cfg = [ "feature=\"use_std\"" ]
} }
rust_component("crossbeam_utils") { rust_component("crossbeam_utils") {
source_root = "$registry_github/crossbeam-utils-0.4.1/src/lib.rs" source_root = "$registry_github/crossbeam-utils-0.4.1/src/lib.rs"
features = [ "use_std" ]
extern = [ ":cfg_if" ] extern = [ ":cfg_if" ]
cfg = [ "feature=\"use_std\"" ]
} }
rust_component("arrayvec") { rust_component("arrayvec") {
@ -334,7 +334,7 @@ rust_component("memoffset") {
rust_component("scopeguard") { rust_component("scopeguard") {
source_root = "$registry_github/scopeguard-0.3.3/src/lib.rs" source_root = "$registry_github/scopeguard-0.3.3/src/lib.rs"
cfg = [ "feature=\"use_std\"" ] features = [ "use_std" ]
} }
rust_component("num_cpus") { rust_component("num_cpus") {

View file

@ -40,7 +40,6 @@ template("run_rustc") {
assert(defined(invoker.source_root), "Must specify source_root") assert(defined(invoker.source_root), "Must specify source_root")
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"cfg",
"crate_name", "crate_name",
"crate_type", "crate_type",
"crate_version", "crate_version",
@ -123,15 +122,6 @@ template("run_rustc") {
args += [ "--test" ] args += [ "--test" ]
} }
if (defined(cfg)) {
foreach(c, cfg) {
args += [
"--cfg",
c,
]
}
}
if (defined(features)) { if (defined(features)) {
foreach(f, features) { foreach(f, features) {
args += [ args += [
@ -210,7 +200,6 @@ template("rust_component") {
forward_variables_from(invoker, forward_variables_from(invoker,
[ [
"args", "args",
"cfg",
"crate_version", "crate_version",
"deps", "deps",
"extern", "extern",