diff --git a/.gitignore b/.gitignore index bc55736..e3e5852 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ vendor/ *.obj *.fbx -*.glb \ No newline at end of file +*.glb +!libassimp_darwin_arm64.dylib +.DS_Store \ No newline at end of file diff --git a/asig/asig.go b/asig/asig.go index fe49727..8f65ee2 100755 --- a/asig/asig.go +++ b/asig/asig.go @@ -1,12 +1,13 @@ package asig /* -//Note: We don't link directly to libIrrXML and libzlib libraries in `./libs`, but they are required by assimp. Removing them will error on compilation. #cgo CFLAGS: -I . -#cgo LDFLAGS: -L ./libs -l assimp_windows_amd64 +#cgo LDFLAGS: -L libs +#cgo windows,amd64 LDFLAGS: -l assimp_windows_amd64 +#cgo darwin,arm64 LDFLAGS: -l assimp_darwin_arm64 -#include -#include //Needed for C.free +#include "wrap.c" +#include */ import "C" import ( diff --git a/asig/libs/libassimp_darwin_arm64.dylib b/asig/libs/libassimp_darwin_arm64.dylib new file mode 100755 index 0000000..d42b3bc Binary files /dev/null and b/asig/libs/libassimp_darwin_arm64.dylib differ diff --git a/asig/material.go b/asig/material.go index 16a9b89..f564527 100755 --- a/asig/material.go +++ b/asig/material.go @@ -2,26 +2,12 @@ package asig /* #cgo CFLAGS: -I . -#cgo LDFLAGS: -L ./libs -l assimp_windows_amd64 -l IrrXML_windows_amd64 -l zlib_windows_amd64 +#cgo LDFLAGS: -L libs +#cgo windows,amd64 LDFLAGS: -l assimp_windows_amd64 +#cgo darwin,arm64 LDFLAGS: -l assimp_darwin_arm64 -#include //Needed for C.free - -#include - -//Functions -unsigned int aiGetMaterialTextureCount(const struct aiMaterial* pMat, enum aiTextureType type); - -enum aiReturn aiGetMaterialTexture( - const struct aiMaterial* mat, - enum aiTextureType type, - unsigned int index, - struct aiString* path, - enum aiTextureMapping* mapping, - unsigned int* uvindex, - ai_real* blend, - enum aiTextureOp* op, - enum aiTextureMapMode* mapmode, - unsigned int* flags); +#include "wrap.c" +#include */ import "C" import ( diff --git a/asig/wrap.cxx b/asig/wrap.c similarity index 100% rename from asig/wrap.cxx rename to asig/wrap.c