Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Naming
  3. corrosion

corrosion

MITCMakev0.6.1

A CMake tool for seamlessly integrating Rust crates (executables and libraries) into existing C/C++ projects.

Visit WebsiteGitHubGitHub
1.5k stars148 forks0 contributors

What is corrosion?

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.

Target Audience

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.

Value Proposition

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.

Overview

Marrying Rust and CMake - Easy Rust and C/C++ Integration!

Use Cases

Best For

  • Incrementally adding Rust modules to a legacy C/C++ CMake project
  • Building mixed-language applications where Rust libraries need to be linked with C++ executables
  • Cross-compiling Rust code for embedded systems within a CMake-based workflow
  • Automating the import of Rust crates as CMake targets for simplified dependency management
  • Setting up CI/CD pipelines for projects combining Rust and C/C++ with a unified build system
  • Reducing manual configuration when integrating Rust's safety features into existing C/C++ codebases

Not Ideal For

  • Projects that do not use CMake as their primary build system
  • Teams integrating Rust with alternative build systems like Bazel or Meson
  • Simple Rust-only applications where Cargo suffices and CMake adds unnecessary overhead
  • Legacy projects locked on CMake versions older than 3.22 (for v0.6)

Pros & Cons

Pros

Automatic Crate Import

Automatically imports Rust executables, static libraries, and dynamic libraries from Cargo.toml, eliminating manual build configuration and reducing errors in mixed-language projects.

Cross-Compilation Support

Provides straightforward cross-compilation for Rust code within CMake, simplifying targeting for embedded systems or multiple platforms without custom scripting.

Seamless C/C++ Linking

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.

Multi-Config Generator Compatibility

Supports CMake's multi-configuration generators like Visual Studio, making it suitable for Windows development and complex IDE-based workflows.

Cons

CMake Version Dependency

Requires CMake 3.22 or newer for the latest release, which can hinder adoption in projects with legacy build systems or strict version constraints.

Rust Ecosystem Assumption

Assumes Rust and Cargo are already configured, adding setup complexity for teams primarily familiar with C/C++ and not the Rust toolchain.

Limited Build System Flexibility

Only integrates with CMake, offering no support for other build systems, which may force teams to overhaul their existing infrastructure if they switch.

Frequently Asked Questions

Quick Stats

Stars1,452
Forks148
Contributors0
Open Issues55
Last commit23 days ago
CreatedSince 2018

Tags

#static-linking#mixed-language#cross-compilation#c#language-integration#cmake#c-plus-plus#build-system#cargo#cplusplus#dynamic-linking#build-systems#rust#cpp#build-tool

Built With

R
Rust
C
CMake

Links & Resources

Website

Included in

Naming1.4k
Auto-fetched 1 day ago

Related Projects

PuppeteerPuppeteer

JavaScript API for Chrome and Firefox

Stars94,483
Forks9,423
Last commit2 days ago
UppyUppy

The next open source file uploader for web browsers :dog:

Stars30,807
Forks2,097
Last commit1 day ago
UglifyUglify

JavaScript parser / mangler / compressor / beautifier toolkit

Stars13,394
Forks1,224
Last commit1 year ago
bubblewrapbubblewrap

Low-level unprivileged sandboxing tool used by Flatpak and similar projects

Stars7,519
Forks345
Last commit6 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub