mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
use #exists to provide good errors for common missing libraries
This commit is contained in:
Vendored
+15
-5
@@ -2,13 +2,23 @@ package stb_vorbis
|
||||
|
||||
import c "core:c/libc"
|
||||
|
||||
@(private)
|
||||
LIB :: (
|
||||
"../lib/stb_vorbis.lib" when ODIN_OS == .Windows
|
||||
else "../lib/stb_vorbis.a" when ODIN_OS == .Linux
|
||||
else "../lib/darwin/stb_vorbis.a" when ODIN_OS == .Darwin
|
||||
else ""
|
||||
)
|
||||
|
||||
when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" }
|
||||
else when ODIN_OS == .Linux { foreign import lib "../lib/stb_vorbis.a" }
|
||||
else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_vorbis.a" }
|
||||
else { foreign import lib "system:stb_vorbis" }
|
||||
|
||||
when LIB != "" {
|
||||
when !#exists(LIB) {
|
||||
#panic("Could not find the compiled STB libraries, they can be compiled by running `make -C \"" + ODIN_ROOT + "vendor/stb/src\"`")
|
||||
}
|
||||
|
||||
foreign import lib { LIB }
|
||||
} else {
|
||||
foreign import lib "system:stb_vorbis"
|
||||
}
|
||||
|
||||
/////////// THREAD SAFETY
|
||||
|
||||
|
||||
Reference in New Issue
Block a user