Skip to content

Commit ae16e3d

Browse files
committed
Remove warning and tell compiler to allow custom cfg flags
1 parent c7416cb commit ae16e3d

File tree

7 files changed

+20
-2
lines changed

7 files changed

+20
-2
lines changed

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
[workspace]
22
members = [
3-
"bolos", "bolos-sys", "bolos-impl", "bolos-mock", "bolos-common", "bolos-derive",
4-
"zemu", "zuit",
3+
"bolos",
4+
"bolos-sys",
5+
"bolos-impl",
6+
"bolos-mock",
7+
"bolos-common",
8+
"bolos-derive",
9+
"zemu",
10+
"zuit",
511
]
612

713
resolver = "2"

bolos-derive/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
fn main() {
22
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
3+
// Tell cargo that bellow are valid cfgs
4+
println!("cargo:rustc-check-cfg=names(\"bolos_sdk\" )");
35

46
if let Some(v) = std::env::var_os("BOLOS_SDK") {
57
if !v.is_empty() {

bolos-impl/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fn detect_device() -> Option<Device> {
2121
fn main() {
2222
println!("cargo:rerun-if-env-changed=TARGET_NAME");
2323
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
24+
// Tell cargo that bellow are valid cfgs
25+
println!("cargo:rustc-check-cfg=names(\"bolos_sdk\")");
2426

2527
if let Some(v) = env::var_os("BOLOS_SDK") {
2628
if !v.is_empty() {

bolos-mock/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
fn main() {
22
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
3+
// Tell cargo that bellow are valid cfgs
4+
println!("cargo:rustc-check-cfg=names(\"bolos_sdk\")");
35

46
if let Some(v) = std::env::var_os("BOLOS_SDK") {
57
if !v.is_empty() {

bolos-sys/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ fn detect_device() -> Option<Device> {
7878
fn main() {
7979
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
8080
println!("cargo:rerun-if-env-changed=TARGET_NAME");
81+
// Tell cargo that bellow are valid cfgs
82+
println!("cargo:rustc-check-cfg=names=bolos_sdk");
8183

8284
if let Some(v) = env::var_os("BOLOS_SDK") {
8385
if !v.is_empty() {

bolos/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
fn main() {
22
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
3+
// Tell cargo that bellow are valid cfgs
4+
println!("cargo:rustc-check-cfg=names(\"bolos_sdk\", \"__impl\", \"__mock\")");
35

46
if let Some(v) = std::env::var_os("BOLOS_SDK") {
57
if !v.is_empty() {

zemu/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ fn detect_device() -> Option<Device> {
2121
fn main() {
2222
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
2323
println!("cargo:rerun-if-env-changed=TARGET_NAME");
24+
// Tell cargo that bellow are valid cfgs
25+
println!("cargo:rustc-check-cfg=names(\"bolos_sdk\", \"zemu_logging\")");
2426

2527
if let Some(v) = env::var_os("BOLOS_SDK") {
2628
if !v.is_empty() {

0 commit comments

Comments
 (0)