asdf
1
Is it possible to include rust files in swift project?
Something like:
SwiftProj
|---Package.swift
|---Sources
|---SwiftModule
|---RustModule
|---libheader.h
|---Cargo.toml
|---src
|---lib.rs
Then just invoke swift build
lukasa
(Cory Benfield)
2
Today it is not possible to do this. In the eventual future it should be possible to run external build tools, but Rust is a complex one to express. I do not believe there is any roadmap to do this today.
2 Likes
SDGGiesbrecht
(Jeremy David Giesbrecht)
3
If this goes through, I suspect something like what you are asking would become possible:
Keith
(Keith Smiley)
4
If you're interested in doing something like this today, and you're willing to put a lot of work into it, you can go down the path of using bazel which supports rust and Swift and they could theoretically intermingle in the same build that way (although I don't know of anyone doing this today for rust specifically)
asdf
5
would it be possible without other build tool?
i mean just invoke swift build and swiftPM will invoke cargo
Keith
(Keith Smiley)
6
Nope, as others said rust isn't supported by swiftpm today.