warrenm / GLTFKit2

A glTF 2.0 asset loader and exporter for Objective-C and Swift.
MIT License
159 stars 29 forks source link

Support for SPM #42

Closed JohanAlbrectsen closed 11 months ago

JohanAlbrectsen commented 11 months ago

I'm currently lost on how to embed this framework in my project. It's a project, not a .framework or xcframework, so I'm a little lost. Would be such a great help to have support for Swift Package Manager. Kind regards

warrenm commented 11 months ago

A couple of times a year, I waste of a day of my life trying to get SPM to work, and every single time, it's a miserable experience. I have made the offer before (#23) that if someone wants to contribute a working Project.swift file, I'll do my best not to break it. I haven't had any takers so far.

The problem is that many aspects of this project (use of multiple languages, idiosyncratic directory structure, using a framework target rather than a static library) go against the grain of SPM's assumptions, and coaxing it into building a usable library while maintaining compatibility across Obj-C and Swift seems nearly impossible.

In the meantime, if you want to incorporate GLTFKit2 into your project as a framework, you can add the self-contained GLTFKit2 project as a subproject of your Xcode workspace. This will make the GLTFKit2.framework target available in the scope of the workspace, and you can link to it in your own app target(s).

warrenm commented 11 months ago

It is now possible to consume GLTFKit2 as an xcframework in Swift projects without the need to compile it yourself or add the project to a workspace. Future tagged releases (starting with 0.5.1) will include updated binaries that incorporate support for KTX2 textures. Draco support remains optionally available via the existing plug-in architecture.

If you have questions or difficulty incorporating the framework in this way, this issue will remain open for the next seven days. Beyond that time, please file new issues detailing your problem or feature request.

JohanAlbrectsen commented 11 months ago

Thank you, will try :)

JohanAlbrectsen commented 10 months ago

It works now with SPM now, you're a hero! You've saved our team, thank you very much!

warrenm commented 10 months ago

Delighted to hear it :)

myselfuser1 commented 8 months ago

Any support for Cocoapods?

warrenm commented 8 months ago

Please don't make new requests on closed issues.

But no, we don't expect to ever support Cocoapods.