Add linux lib for odin bindings

This commit is contained in:
Nic Barker 2024-09-01 10:35:04 +12:00
parent b64e318cdb
commit 3e7738bee5
6 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,13 @@
cp ../../clay.h clay.c;
# Intel Mac
clang -c -o clay.o -static -target x86_64-apple-darwin clay.c -fPIC && ar r clay-odin/macos/clay.a clay.o;
# ARM Mac
clang -c -o clay.o -static clay.c -fPIC && ar r clay-odin/macos-arm64/clay.a clay.o;
# x64 Windows
clang -c -o clay-odin/windows/clay.lib -target x86_64-pc-windows-msvc -fuse-ld=llvm-lib -static clay.c;
# Linux
clang -c -o clay.o -static -target x86_64-unknown-linux-gnu clay.c -fPIC && ar r clay-odin/linux/clay.a clay.o;
# WASM
clang -c -o clay-odin/wasm/clay.o -target wasm32 -nostdlib -static clay.c;
rm clay.o;
rm clay.c;

View File

@ -6,7 +6,7 @@ import "core:strings"
when ODIN_OS == .Windows {
foreign import Clay "windows/clay.lib"
} else when ODIN_OS == .Linux {
foreign import Clay "linux/libclay.a"
foreign import Clay "linux/clay.a"
} else when ODIN_OS == .Darwin {
when ODIN_ARCH == .arm64 {
foreign import Clay "macos-arm64/clay.a"
@ -246,7 +246,7 @@ foreign Clay {
}
@(private, link_prefix = "Clay_", default_calling_convention = "c")
foreign {
foreign _ {
_layoutConfigs: ClayArray(LayoutConfig)
_rectangleElementConfigs: ClayArray(RectangleElementConfig)
_textElementConfigs: ClayArray(TextElementConfig)

Binary file not shown.

Binary file not shown.