Conversation
|
Hi, and thanks for the PR! I'm not very familiar with using Cmake with Rust, so could you explain a bit what this enables? |
|
I'm still curious what use-case would benefit from that. Is this when integrating this rust library in a larger, multiple-languages project? As a note, |
|
For example, rocksdb (a kv engine) optionally depend on zstd. To enable zstd support for its rust wrapper, it can either just add zstd-sys as a dependency or add zstd c sources as a submodule then write the build.rs (again). |
|
Another example, git-sys depends on ssh2 and libz, but it doesn't have to add each as a submodule, but just depend on their *-sys packages instead. It's actually a study case listed in crates.io. |
|
I'm beginning to understand: rust-rocksdb wants to build rocksdb using cmake, and have it auto-detect the zstd library? In that case, Not sure if that's relevant, but zstd itself includes a CMakeList file. EDIT: Aah, this last chapter of the crates.io page does make it clearer indeed. |
|
Thanks for the information. I updated the pr, |
|
Well, thanks for the explanations! Looking at the current
Also, the |
Not necessary, as long as the library exist in CMAKE_PREFIX_PATH, which is set by
cmake-rs will set the
Fixed. This is tested in tikv/rust-rocksdb#159. But we only use rocksdb 5.7.3 now, which doesn't include |
|
Ah, I see. Looks good then! Thanks again! |
So we can call
cmake::Build().register_dep("ZSTD").