swift : revert package changes
This reverts #10525 and make swift package works at latest commit.
Reasons:
-
The swift package can't run cmake if llama.cpp is imported from SPM by any Xcode project. For example, we should able to use llama package by add to Package Dependencies:
-
If we want to build llama-swiftui example for other platform like visionOS or tvOS, the building process will being complicated.
We may can include dylib or xcframework to the package, but we would need upload binaries to other places and use binaryTarget.
The problem is still that duplicating the build process in Package.swift is not reasonable. The build script is updated continuously, and it is simply not reasonable to duplicate all the behavior of the cmake build scripts in the Package.swift. The solution must be able to use cmake to build llama.cpp.
I don't know anything about Swift, that was just the solution that I found after a quick search, but I am sure that a experienced Swift programmer could come up with a solution that satisfies all the requirements.
@jhen0409 I tested llama.swiftui off of your branch and I was able to build and run the application on my iOS device. However, when I load a model and send a prompt, the app crashes. Are you experiencing the same thing?
I tested this on a previous commit way before CMake was added and it worked. This issue might not necessarily be related to your PR, but I'm just curious if you've tested llama.swiftui on iOS yet. Thanks!
@jhen0409 I tested llama.swiftui off of your branch and I was able to build and run the application on my iOS device. However, when I load a model and send a prompt, the app crashes. Are you experiencing the same thing?
I tested this on a previous commit way before CMake was added and it worked. This issue might not necessarily be related to your PR, but I'm just curious if you've tested llama.swiftui on iOS yet. Thanks!
Some fixes has been pushed into master, but not included in this branch.
Superseded by #11996