mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-23 12:02:28 +00:00
windows create dylibs for gen tests
This commit is contained in:
parent
f601a56d52
commit
fc369ddebb
1 changed files with 46 additions and 19 deletions
|
@ -1104,10 +1104,34 @@ 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)> {
|
||||||
let zig_str_path = find_zig_str_path();
|
let zig_str_path = find_zig_str_path();
|
||||||
|
|
||||||
|
match link_type {
|
||||||
|
LinkType::Dylib => {
|
||||||
|
let child = Command::new(&zig_executable())
|
||||||
|
.args(&["build-lib"])
|
||||||
|
.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",
|
||||||
|
"-dynamic"
|
||||||
|
])
|
||||||
|
.spawn()?;
|
||||||
|
|
||||||
|
Ok((child, output_path))
|
||||||
|
}
|
||||||
|
LinkType::Executable => {
|
||||||
let child = Command::new(&zig_executable())
|
let child = Command::new(&zig_executable())
|
||||||
.args(&["build-exe"])
|
.args(&["build-exe"])
|
||||||
.args(input_paths)
|
.args(input_paths)
|
||||||
|
@ -1128,6 +1152,9 @@ fn link_windows(
|
||||||
|
|
||||||
Ok((child, output_path))
|
Ok((child, output_path))
|
||||||
}
|
}
|
||||||
|
LinkType::None => todo!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn llvm_module_to_dylib(
|
pub fn llvm_module_to_dylib(
|
||||||
module: &inkwell::module::Module,
|
module: &inkwell::module::Module,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue