mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
v.pref: set DYLD_FALLBACK_LIBRARY_PATH
on macos, when -use-coroutines
is used, so that v run
can work, and the executable can find the downloaded photonwrapper shared library (#23516)
This commit is contained in:
parent
9871050603
commit
11c59cf8b9
1 changed files with 8 additions and 0 deletions
|
@ -987,6 +987,14 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
|
||||||
}
|
}
|
||||||
res.compile_defines << 'is_coroutine'
|
res.compile_defines << 'is_coroutine'
|
||||||
res.compile_defines_all << 'is_coroutine'
|
res.compile_defines_all << 'is_coroutine'
|
||||||
|
$if macos {
|
||||||
|
dyld_fallback_paths := os.getenv('DYLD_FALLBACK_LIBRARY_PATH')
|
||||||
|
so_dir := os.dir(so_path)
|
||||||
|
if !dyld_fallback_paths.contains(so_dir) {
|
||||||
|
env := [dyld_fallback_paths, so_dir].filter(it.len).join(':')
|
||||||
|
os.setenv('DYLD_FALLBACK_LIBRARY_PATH', env, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
} $else {
|
} $else {
|
||||||
println('coroutines only work on macos & linux for now')
|
println('coroutines only work on macos & linux for now')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue