mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
use #exists to provide good errors for common missing libraries
This commit is contained in:
+17
-4
@@ -4,10 +4,23 @@ import "core:c"
|
||||
|
||||
#assert(size_of(b32) == size_of(c.int))
|
||||
|
||||
when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" }
|
||||
else when ODIN_OS == .Linux { foreign import lib "../lib/stb_rect_pack.a" }
|
||||
else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_rect_pack.a" }
|
||||
else { foreign import lib "system:stb_rect_pack" }
|
||||
@(private)
|
||||
LIB :: (
|
||||
"../lib/stb_rect_pack.lib" when ODIN_OS == .Windows
|
||||
else "../lib/stb_rect_pack.a" when ODIN_OS == .Linux
|
||||
else "../lib/darwin/stb_rect_pack.a" when ODIN_OS == .Darwin
|
||||
else ""
|
||||
)
|
||||
|
||||
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_rect_pack"
|
||||
}
|
||||
|
||||
Coord :: distinct c.int
|
||||
_MAXVAL :: max(Coord)
|
||||
|
||||
Reference in New Issue
Block a user