Skip to content

Commit 0810e84

Browse files
author
Mark aka walkingdevel
authored
coroutines: add macOS amd64 support, panic on wget errors (#18360)
1 parent c06fd55 commit 0810e84

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

vlib/v/pref/pref.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,21 +802,22 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
802802
}
803803
'-use-coroutines' {
804804
res.use_coroutines = true
805-
$if macos && arm64 {
805+
$if macos {
806+
arch := $if arm64 { 'arm64' } $else { 'amd64' }
806807
vexe := vexe_path()
807808
vroot := os.dir(vexe)
808809
so_path := os.join_path(vroot, 'thirdparty', 'photon', 'photonwrapper.so')
809-
so_url := 'https://github.com/vlang/photonbin/raw/master/photonwrapper_macos_arm64.so'
810+
so_url := 'https://github.com/vlang/photonbin/raw/master/photonwrapper_macos_${arch}.so'
810811
if !os.exists(so_path) {
811812
println('coroutines .so not found, downloading...')
812813
// http.download_file(so_url, so_path) or { panic(err) }
813-
os.system('wget -O "${so_path}" "${so_url}"')
814+
os.execute_or_panic('wget -O "${so_path}" "${so_url}"')
814815
println('done!')
815816
}
816817
res.compile_defines << 'is_coroutine'
817818
res.compile_defines_all << 'is_coroutine'
818819
} $else {
819-
println('coroutines only work on arm64 macos for now')
820+
println('coroutines only work on macos for now')
820821
}
821822
}
822823
else {

0 commit comments

Comments
 (0)