Add system libs when cross compiling for Windows

This commit is contained in:
Chris Denton 2024-09-15 11:02:41 +00:00
parent 1ae268816c
commit 7223fd8085
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE

View File

@ -220,7 +220,10 @@ fn main() {
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--libs");
if !is_crossed {
// Don't link system libs if cross-compiling unless targetting Windows.
// On Windows system DLLs aren't linked directly, instead import libraries are used.
// These import libraries are independent of the host.
if !is_crossed || target.contains("windows") {
cmd.arg("--system-libs");
}