mirror of
https://github.com/nicbarker/clay.git
synced 2025-01-23 18:06:04 +00:00
Add linux lib for odin bindings
This commit is contained in:
parent
b64e318cdb
commit
3e7738bee5
@ -1,7 +1,13 @@
|
|||||||
cp ../../clay.h clay.c;
|
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;
|
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;
|
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;
|
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;
|
clang -c -o clay-odin/wasm/clay.o -target wasm32 -nostdlib -static clay.c;
|
||||||
rm clay.o;
|
rm clay.o;
|
||||||
rm clay.c;
|
rm clay.c;
|
||||||
|
@ -6,7 +6,7 @@ import "core:strings"
|
|||||||
when ODIN_OS == .Windows {
|
when ODIN_OS == .Windows {
|
||||||
foreign import Clay "windows/clay.lib"
|
foreign import Clay "windows/clay.lib"
|
||||||
} else when ODIN_OS == .Linux {
|
} else when ODIN_OS == .Linux {
|
||||||
foreign import Clay "linux/libclay.a"
|
foreign import Clay "linux/clay.a"
|
||||||
} else when ODIN_OS == .Darwin {
|
} else when ODIN_OS == .Darwin {
|
||||||
when ODIN_ARCH == .arm64 {
|
when ODIN_ARCH == .arm64 {
|
||||||
foreign import Clay "macos-arm64/clay.a"
|
foreign import Clay "macos-arm64/clay.a"
|
||||||
@ -14,7 +14,7 @@ when ODIN_OS == .Windows {
|
|||||||
foreign import Clay "macos/clay.a"
|
foreign import Clay "macos/clay.a"
|
||||||
}
|
}
|
||||||
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
||||||
foreign import Clay "wasm/clay.o"
|
foreign import Clay "wasm/clay.o"
|
||||||
}
|
}
|
||||||
|
|
||||||
String :: struct {
|
String :: struct {
|
||||||
@ -246,7 +246,7 @@ foreign Clay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@(private, link_prefix = "Clay_", default_calling_convention = "c")
|
@(private, link_prefix = "Clay_", default_calling_convention = "c")
|
||||||
foreign {
|
foreign _ {
|
||||||
_layoutConfigs: ClayArray(LayoutConfig)
|
_layoutConfigs: ClayArray(LayoutConfig)
|
||||||
_rectangleElementConfigs: ClayArray(RectangleElementConfig)
|
_rectangleElementConfigs: ClayArray(RectangleElementConfig)
|
||||||
_textElementConfigs: ClayArray(TextElementConfig)
|
_textElementConfigs: ClayArray(TextElementConfig)
|
||||||
|
BIN
bindings/odin/clay-odin/linux/clay.a
Normal file
BIN
bindings/odin/clay-odin/linux/clay.a
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user