diff --git a/bindings/odin/build-clay-lib.sh b/bindings/odin/build-clay-lib.sh index 590f80a..17870d9 100755 --- a/bindings/odin/build-clay-lib.sh +++ b/bindings/odin/build-clay-lib.sh @@ -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; diff --git a/bindings/odin/clay-odin/clay.odin b/bindings/odin/clay-odin/clay.odin index 7aacb0f..f655f3d 100644 --- a/bindings/odin/clay-odin/clay.odin +++ b/bindings/odin/clay-odin/clay.odin @@ -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" @@ -14,7 +14,7 @@ when ODIN_OS == .Windows { foreign import Clay "macos/clay.a" } } else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 { - foreign import Clay "wasm/clay.o" + foreign import Clay "wasm/clay.o" } String :: struct { @@ -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) diff --git a/bindings/odin/clay-odin/linux/clay.a b/bindings/odin/clay-odin/linux/clay.a new file mode 100644 index 0000000..f6a59c7 Binary files /dev/null and b/bindings/odin/clay-odin/linux/clay.a differ diff --git a/bindings/odin/clay-odin/macos-arm64/clay.a b/bindings/odin/clay-odin/macos-arm64/clay.a index 3f8d1f3..37f765b 100644 Binary files a/bindings/odin/clay-odin/macos-arm64/clay.a and b/bindings/odin/clay-odin/macos-arm64/clay.a differ diff --git a/bindings/odin/clay-odin/macos/clay.a b/bindings/odin/clay-odin/macos/clay.a index de77393..0608ed1 100644 Binary files a/bindings/odin/clay-odin/macos/clay.a and b/bindings/odin/clay-odin/macos/clay.a differ diff --git a/bindings/odin/clay-odin/windows/clay.lib b/bindings/odin/clay-odin/windows/clay.lib index 5acb144..c4a727b 100644 Binary files a/bindings/odin/clay-odin/windows/clay.lib and b/bindings/odin/clay-odin/windows/clay.lib differ