Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix non-MSVC builds on Windows and cross-compilation in general
Simple cfg!(target_* = "...") doesn't work in build scripts the way it does in crate's code, because build scripts are being compiled for the toolchain's target triple -- not the default-host nor the cargo's eventual target. Instead, such configuration should be loaded from provided environment variables at run-time. While initially trying to fix linkage issues for Windows + MinGW target (first reported by @stuartZhang in #150), I came to realize in the process that cfg!(target_os = ...), although being used only for OS X at this moment, is likely screwed up in the same way (except, who would ever cross-compile to or from Mac, and why?) https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts Fixes #154
- Loading branch information