link_windows

just uses zig
This commit is contained in:
Folkert de Vries 2022-08-01 23:21:51 +02:00
parent 06e5fe8cba
commit 6f3c8477e6

View file

@ -1096,11 +1096,32 @@ fn link_wasm32(
fn link_windows( fn link_windows(
_target: &Triple, _target: &Triple,
_output_path: PathBuf, output_path: PathBuf,
_input_paths: &[&str], input_paths: &[&str],
_link_type: LinkType, _link_type: LinkType,
) -> io::Result<(Child, PathBuf)> { ) -> io::Result<(Child, PathBuf)> {
todo!("Add windows support to the surgical linker. See issue #2608.") let zig_str_path = find_zig_str_path();
let wasi_libc_path = find_wasi_libc_path();
let child = Command::new(&zig_executable())
.args(&["build-exe"])
.args(input_paths)
.args([
"-lc",
&format!("-femit-bin={}", output_path.to_str().unwrap()),
"-target",
"native",
"--pkg-begin",
"str",
zig_str_path.to_str().unwrap(),
"--pkg-end",
"--strip",
"-O",
"Debug",
])
.spawn()?;
Ok((child, output_path))
} }
pub fn llvm_module_to_dylib( pub fn llvm_module_to_dylib(