diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index f1d61d7234..afa6cc4e2b 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -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_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 { println('coroutines only work on macos & linux for now') }