Integrate Rust into CMake with Corrosion
masterCorrosion (formerly cmake-cargo) allows you to integrate Rust into existing CMake projects by automatically importing Rust executables, static libraries, and dynamic libraries as native CMake targets.
Once imported, you can use standard CMake commands like target_link_libraries() to link Rust-generated static and dynamic libraries into your C/C++ targets.
For Rust executables and dynamic libraries, Corrosion provides a specialized helper function corrosion_link_libraries to simplify adding the required flags for linking C/C++ libraries into the Rust target.