mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
grab str.zig path from lib folder relative to exe
This commit is contained in:
parent
4220b02913
commit
1dd8b16e12
1 changed files with 10 additions and 0 deletions
|
@ -65,6 +65,16 @@ pub fn link(
|
|||
}
|
||||
|
||||
fn find_zig_str_path() -> PathBuf {
|
||||
// First try using the lib path relative to the executable location.
|
||||
let exe_relative_str_path = std::env::current_exe()
|
||||
.ok()
|
||||
.and_then(|path| Some(path.parent()?.join("lib").join("str.zig")));
|
||||
if let Some(exe_relative_str_path) = exe_relative_str_path {
|
||||
if std::path::Path::exists(&exe_relative_str_path) {
|
||||
return exe_relative_str_path.into();
|
||||
}
|
||||
}
|
||||
|
||||
let zig_str_path = PathBuf::from("crates/compiler/builtins/bitcode/src/str.zig");
|
||||
|
||||
if std::path::Path::exists(&zig_str_path) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue