Skip to content

Commit aa95634

Browse files
committed
Some environments don't have CARGO_CFG_TARGET_FEATURE?
1 parent 80854f0 commit aa95634

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

aws-lc-fips-sys/builder/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,12 @@ fn prepare_cargo_cfg() {
475475
}
476476

477477
fn is_crt_static() -> bool {
478-
let features = cargo_env("CARGO_CFG_TARGET_FEATURE");
479-
features.contains("crt-static")
478+
// Some cross-compilation environment apparently don't have this defined.
479+
if let Some(features) = option_env("CARGO_CFG_TARGET_FEATURE") {
480+
features.contains("crt-static")
481+
} else {
482+
false
483+
}
480484
}
481485

482486
bindgen_available!(

0 commit comments

Comments
 (0)