A CMake tool for seamlessly integrating Rust crates (executables and libraries) into existing C/C++ projects.
Corrosion is a CMake tool that facilitates the integration of Rust code into existing CMake projects, primarily those written in C/C++. It automates the import of Rust crates (executables, static libraries, and dynamic libraries) from Cargo manifests, allowing developers to seamlessly link Rust components with C/C++ code. This solves the problem of manual, error-prone build configuration when combining these languages.
Developers working on mixed-language projects that combine Rust with C/C++, especially those already using CMake as their build system. It is ideal for teams looking to incrementally adopt Rust within an existing codebase.
Developers choose Corrosion because it automates the complex build integration between Rust and CMake, reducing configuration overhead and ensuring correct linking. Its declarative approach and support for cross-compilation make it a robust, maintainable solution compared to manual scripting or custom build setups.
Marrying Rust and CMake - Easy Rust and C/C++ Integration!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically imports Rust executables, static libraries, and dynamic libraries from Cargo.toml, eliminating manual build configuration and reducing errors in mixed-language projects.
Provides straightforward cross-compilation for Rust code within CMake, simplifying targeting for embedded systems or multiple platforms without custom scripting.
Enables trivial linking of Rust targets with in-tree C/C++ libraries, as shown in the README example where a C++ executable links to a Rust library with minimal code.
Supports CMake's multi-configuration generators like Visual Studio, making it suitable for Windows development and complex IDE-based workflows.
Requires CMake 3.22 or newer for the latest release, which can hinder adoption in projects with legacy build systems or strict version constraints.
Assumes Rust and Cargo are already configured, adding setup complexity for teams primarily familiar with C/C++ and not the Rust toolchain.
Only integrates with CMake, offering no support for other build systems, which may force teams to overhaul their existing infrastructure if they switch.