Creating an install target for a pure Rust C API #541
Replies: 1 comment
-
Im currently travelling without my laptop, but at first glance your cmake code is not telling rustc to add the soname / install_name. You can see the following discussion in the corrosion guide: https://corrosion-rs.github.io/corrosion/common_issues.html#missing-soname-on-linux-for-cdylibs That doesn't really answer your question, but I believe setting the soname is also something you must do for your usecase. I'd also recommend asking this question on the CMake discourse forum. From the perspective of CMake corrosion imports shared libraries as an "IMPORTED SHARED" library. I'm not overly familiar with the newer installation features added in recent cmake versions - so perhaps there is something besides install(FILE) which is better suited. |
Beta Was this translation helpful? Give feedback.
-
Hey, I'm making a C API in Rust using corrosion/cmake as the build tools to include in another cmake project. I know that I could simply do
cargo build --release
and it'll create my dynamic library/static library, but I want to use cmake to build a deployable package.I'm hoping I could take the following
CMakeLists.txt
and produce a folder structure that looks like this:The Structure
The CMakeLists File
How would I go about doing this? Also, if there's anything glaringly obviously bad with my file, then I'll happily take advise.
Beta Was this translation helpful? Give feedback.
All reactions