Skip to content

Commit

Permalink
Remove warning and tell compiler to allow custom cfg flags
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Jan 19, 2025
1 parent c7416cb commit bdb236e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[workspace]
members = [
"bolos", "bolos-sys", "bolos-impl", "bolos-mock", "bolos-common", "bolos-derive",
"zemu", "zuit",
"bolos",
"bolos-sys",
"bolos-impl",
"bolos-mock",
"bolos-common",
"bolos-derive",
"zemu",
"zuit",
]

resolver = "2"
Expand Down
2 changes: 2 additions & 0 deletions bolos-derive/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fn main() {
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");

if let Some(v) = std::env::var_os("BOLOS_SDK") {
if !v.is_empty() {
Expand Down
2 changes: 2 additions & 0 deletions bolos-impl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ fn detect_device() -> Option<Device> {
fn main() {
println!("cargo:rerun-if-env-changed=TARGET_NAME");
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");

if let Some(v) = env::var_os("BOLOS_SDK") {
if !v.is_empty() {
Expand Down
2 changes: 2 additions & 0 deletions bolos-mock/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fn main() {
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");

if let Some(v) = std::env::var_os("BOLOS_SDK") {
if !v.is_empty() {
Expand Down
2 changes: 2 additions & 0 deletions bolos-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ fn detect_device() -> Option<Device> {
fn main() {
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
println!("cargo:rerun-if-env-changed=TARGET_NAME");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");

if let Some(v) = env::var_os("BOLOS_SDK") {
if !v.is_empty() {
Expand Down
4 changes: 4 additions & 0 deletions bolos/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
fn main() {
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");
println!("cargo:rustc-check-cfg=names=__impl");
println!("cargo:rustc-check-cfg=names=__mock");

if let Some(v) = std::env::var_os("BOLOS_SDK") {
if !v.is_empty() {
Expand Down
3 changes: 3 additions & 0 deletions zemu/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ fn detect_device() -> Option<Device> {
fn main() {
println!("cargo:rerun-if-env-changed=BOLOS_SDK");
println!("cargo:rerun-if-env-changed=TARGET_NAME");
// Tell cargo that bellow are valid cfgs
println!("cargo:rustc-check-cfg=names=bolos_sdk");
println!("cargo:rustc-check-cfg=names=zemu_logging");

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

0 comments on commit bdb236e

Please sign in to comment.