mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
make filenames cross-platform
This commit is contained in:
parent
42ef5d1977
commit
e8f6f69bff
1 changed files with 22 additions and 8 deletions
|
@ -482,15 +482,29 @@ pub fn rebuild_host(
|
|||
host_input_path.with_file_name("host.bc")
|
||||
}
|
||||
} else {
|
||||
host_input_path.with_file_name(if shared_lib_path.is_some() {
|
||||
"dynhost"
|
||||
let os = roc_target::OperatingSystem::from(target.operating_system);
|
||||
|
||||
if shared_lib_path.is_some() {
|
||||
let extension = match os {
|
||||
roc_target::OperatingSystem::Windows => "exe",
|
||||
roc_target::OperatingSystem::Unix => "",
|
||||
roc_target::OperatingSystem::Wasi => "",
|
||||
};
|
||||
|
||||
host_input_path
|
||||
.with_file_name("dynhost")
|
||||
.with_extension(extension)
|
||||
} else {
|
||||
match roc_target::OperatingSystem::from(target.operating_system) {
|
||||
roc_target::OperatingSystem::Windows => "host.obj",
|
||||
roc_target::OperatingSystem::Unix => "host.o",
|
||||
roc_target::OperatingSystem::Wasi => "host.o",
|
||||
}
|
||||
})
|
||||
let extension = match os {
|
||||
roc_target::OperatingSystem::Windows => "obj",
|
||||
roc_target::OperatingSystem::Unix => "o",
|
||||
roc_target::OperatingSystem::Wasi => "o",
|
||||
};
|
||||
|
||||
host_input_path
|
||||
.with_file_name("host")
|
||||
.with_extension(extension)
|
||||
}
|
||||
};
|
||||
|
||||
let env_path = env::var("PATH").unwrap_or_else(|_| "".to_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue