Hide benchmarks behind a feature flag (#5024)

* Hide benchmarks behind a feature flag

* Propage attributes in impl_runtime_apis macro

* Bump impl_version

* Fillter cfg attributes

* Hide more things under the feature

* Fix set_block_number availability

* Rename filter_attrs -> filter_cfg_attrs

* Rename runtime_benchmarks to runtime-benchmarks
This commit is contained in:
Benjamin Kampmann
2020-03-05 10:40:55 +01:00
committed by GitHub
parent 8bf855b09d
commit ff2a36d7cb
11 changed files with 68 additions and 16 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ codec = { package = "parity-scale-codec", version = "1.2.0", default-features =
sp-std = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/std" }
sp-io = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "2.0.0-alpha.2", default-features = false, path = "../../primitives/runtime" }
frame-benchmarking = { version = "2.0.0-alpha.2", default-features = false, path = "../benchmarking" }
frame-benchmarking = { version = "2.0.0-alpha.2", default-features = false, path = "../benchmarking", optional = true }
frame-support = { version = "2.0.0-alpha.2", default-features = false, path = "../support" }
frame-system = { version = "2.0.0-alpha.2", default-features = false, path = "../system" }
@@ -34,3 +34,4 @@ std = [
"frame-support/std",
"frame-system/std",
]
runtime-benchmarks = ["frame-benchmarking"]
+1
View File
@@ -155,6 +155,7 @@ mod tests_composite;
#[cfg(test)]
#[macro_use]
mod tests;
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
use sp_std::prelude::*;