0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

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") {
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") {

View file

@ -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",