cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
} else if target.contains("freebsd") {
cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
+ } else if target.contains("windows") {
+ cfg.define("CMAKE_SYSTEM_NAME", "Windows");
}
cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--ldflags");
for lib in output(&mut cmd).split_whitespace() {
- if lib.starts_with("-LIBPATH:") {
- println!("cargo:rustc-link-search=native={}", &lib[9..]);
- } else if is_crossed {
- if lib.starts_with("-L") {
+ if is_crossed {
+ if lib.starts_with("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", lib[9..].replace(&host, &target));
+ } else if lib.starts_with("-L") {
println!("cargo:rustc-link-search=native={}", lib[2..].replace(&host, &target));
}
+ } else if lib.starts_with("-LIBPATH:") {
+ println!("cargo:rustc-link-search=native={}", &lib[9..]);
} else if lib.starts_with("-l") {
println!("cargo:rustc-link-lib={}", &lib[2..]);
} else if lib.starts_with("-L") {