Have default foreign import system paths

This commit is contained in:
gingerBill
2024-01-17 16:32:26 +00:00
parent 12e53f2336
commit d9fafa7000
7 changed files with 27 additions and 18 deletions

View File

@@ -25,6 +25,8 @@ when ODIN_OS == .Windows {
foreign import lib "system:cmark"
} else when ODIN_OS == .Darwin {
foreign import lib "system:cmark"
} else {
foreign import lib "system:cmark"
}
Option :: enum c.int {

View File

@@ -4,9 +4,10 @@ import c "core:c/libc"
#assert(size_of(c.int) == size_of(b32))
when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" }
when ODIN_OS == .Linux { foreign import stbi "../lib/stb_image.a" }
when ODIN_OS == .Darwin { foreign import stbi "../lib/darwin/stb_image.a" }
when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" }
else when ODIN_OS == .Linux { foreign import stbi "../lib/stb_image.a" }
else when ODIN_OS == .Darwin { foreign import stbi "../lib/darwin/stb_image.a" }
else { foreign import stbi "system:stb_image" }
#assert(size_of(b32) == size_of(c.int))

View File

@@ -2,9 +2,11 @@ package stb_image
import c "core:c/libc"
when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" }
when ODIN_OS == .Linux { foreign import lib "../lib/stb_image_resize.a" }
when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_image_resize.a" }
when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" }
else when ODIN_OS == .Linux { foreign import lib "../lib/stb_image_resize.a" }
else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_image_resize.a" }
else { foreign import stbi "system:stb_image_resize" }
//////////////////////////////////////////////////////////////////////////////
//

View File

@@ -2,9 +2,10 @@ package stb_image
import c "core:c/libc"
when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" }
when ODIN_OS == .Linux { foreign import stbiw "../lib/stb_image_write.a" }
when ODIN_OS == .Darwin { foreign import stbiw "../lib/darwin/stb_image_write.a" }
when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" }
else when ODIN_OS == .Linux { foreign import stbiw "../lib/stb_image_write.a" }
else when ODIN_OS == .Darwin { foreign import stbiw "../lib/darwin/stb_image_write.a" }
else { foreign import stbi "system:stb_image_write" }
write_func :: proc "c" (ctx: rawptr, data: rawptr, size: c.int)

View File

@@ -4,9 +4,10 @@ import c "core:c/libc"
#assert(size_of(b32) == size_of(c.int))
when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" }
when ODIN_OS == .Linux { foreign import lib "../lib/stb_rect_pack.a" }
when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_rect_pack.a" }
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" }
Coord :: distinct c.int
_MAXVAL :: max(Coord)

View File

@@ -3,9 +3,10 @@ package stb_truetype
import c "core:c"
import stbrp "vendor:stb/rect_pack"
when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" }
when ODIN_OS == .Linux { foreign import stbtt "../lib/stb_truetype.a" }
when ODIN_OS == .Darwin { foreign import stbtt "../lib/darwin/stb_truetype.a" }
when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" }
else when ODIN_OS == .Linux { foreign import stbtt "../lib/stb_truetype.a" }
else when ODIN_OS == .Darwin { foreign import stbtt "../lib/darwin/stb_truetype.a" }
else { foreign import stbtt "system:stb_truetype" }
///////////////////////////////////////////////////////////////////////////////

View File

@@ -3,9 +3,10 @@ package stb_vorbis
import c "core:c/libc"
when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" }
when ODIN_OS == .Linux { foreign import lib "../lib/stb_vorbis.a" }
when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_vorbis.a" }
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" }