diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-03-13 17:47:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-13 17:47:18 +0000 |
| commit | e68d3c8bbcfaa37b145129be7bedb4379da3ff2b (patch) | |
| tree | 17d6f6ebe86e27a300dbd1bd2cb46a4c1fa70b77 | |
| parent | 97d6bf6d8f0f6e0815570cb1c798f35dc77cec47 (diff) | |
| parent | b539bb26935a29a4c59b8d241f76eb352e94f839 (diff) | |
Merge pull request #3143 from Pariatech/cgltf-linux-build
Adding linux & darwin makefile for cgltf
| -rw-r--r-- | vendor/cgltf/cgltf.odin | 8 | ||||
| -rw-r--r-- | vendor/cgltf/src/Makefile | 20 |
2 files changed, 24 insertions, 4 deletions
diff --git a/vendor/cgltf/cgltf.odin b/vendor/cgltf/cgltf.odin index f432d0f0c..024e8dfaa 100644 --- a/vendor/cgltf/cgltf.odin +++ b/vendor/cgltf/cgltf.odin @@ -1,9 +1,9 @@ -//+build windows package cgltf -when ODIN_OS == .Windows { - foreign import lib "lib/cgltf.lib" -} +when ODIN_OS == .Windows { foreign import lib "lib/cgltf.lib" } +else when ODIN_OS == .Linux { foreign import lib "lib/cgltf.a" } +else when ODIN_OS == .Darwin { foreign import lib "lib/darwin/cgltf.a" } +else { foreign import lib "system:cgltf" } import "core:c" diff --git a/vendor/cgltf/src/Makefile b/vendor/cgltf/src/Makefile new file mode 100644 index 000000000..ede3d158e --- /dev/null +++ b/vendor/cgltf/src/Makefile @@ -0,0 +1,20 @@ +OS=$(shell uname) + +ifeq ($(OS), Darwin) +all: darwin +else +all: unix +endif + +unix: + mkdir -p ../lib + $(CC) -c -O2 -Os -fPIC cgltf.c + $(AR) rcs ../lib/cgltf.a cgltf.o + rm *.o + +darwin: + mkdir -p ../lib/darwin + $(CC) -arch x86_64 -c -O2 -Os -fPIC cgltf.c -o cgltf-x86_64.o -mmacosx-version-min=10.12 + $(CC) -arch arm64 -c -O2 -Os -fPIC cgltf.c -o cgltf-arm64.o -mmacosx-version-min=10.12 + lipo -create cgltf-x86_64.o cgltf-arm64.o -output ../lib/darwin/cgltf.a + rm *.o |