build.rs now uses env::var("CARGO_CFG_TARGET_OS") to check which os the build is targetting. Unfortunately, in build.rs target_os is always host_os. So we have to check for the enviornment variable.
This is generally the recommened way to check for the target_os inside build.rs:
build.rs now uses env::var("CARGO_CFG_TARGET_OS") to check which os the build is targetting. Unfortunately, in build.rs target_os is always host_os. So we have to check for the enviornment variable.
This is generally the recommened way to check for the target_os inside build.rs: