use the windows builtins .obj when cross-compiling

This commit is contained in:
Folkert 2022-08-30 14:27:16 +02:00
parent e8f6f69bff
commit a274da62d3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -121,11 +121,20 @@ pub fn build_zig_host_native(
.env("HOME", env_home); .env("HOME", env_home);
if let Some(shared_lib_path) = shared_lib_path { if let Some(shared_lib_path) = shared_lib_path {
// with LLVM, the builtins are already part of the roc app,
// but with the dev backend, they are missing. To minimize work,
// we link them as part of the host executable
let builtins_obj = if target.contains("windows") {
bitcode::get_builtins_windows_obj_path()
} else {
bitcode::get_builtins_host_obj_path()
};
command.args(&[ command.args(&[
"build-exe", "build-exe",
"-fPIE", "-fPIE",
shared_lib_path.to_str().unwrap(), shared_lib_path.to_str().unwrap(),
&bitcode::get_builtins_host_obj_path(), &builtins_obj,
]); ]);
} else { } else {
command.args(&["build-obj", "-fPIC"]); command.args(&["build-obj", "-fPIC"]);