Skip to content

Commit 1714136

Browse files
authored
Auto merge of servo#216 - tomaka:non-family-platforms, r=jdm
Don't panic if CARGO_CFG_TARGET_FAMILY isn't set The `CARGO_CFG_TARGET_FAMILY` environment variable isn't defined for non-unix-non-windows platforms. For context, I'm trying to add support for my custom platform. While I'm obviously not going to try upstream this custom platform, the change in this PR looks positive to me.
2 parents 7222628 + 4ae9459 commit 1714136

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

surfman/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ fn main() {
3030
}
3131

3232
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
33-
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap();
33+
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").ok();
3434
let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
3535

3636
// Generate EGL bindings.
3737
if target_os == "android"
3838
|| (target_os == "windows" && cfg!(feature = "sm-angle"))
39-
|| target_family == "unix"
39+
|| target_family.as_ref().map_or(false, |f| f == "unix")
4040
{
4141
let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap();
4242
let registry = Registry::new(Api::Egl, (1, 5), Profile::Core, Fallbacks::All, []);

0 commit comments

Comments
 (0)