• Stars
    star
    188
  • Rank 205,536 (Top 5 %)
  • Language CMake
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Corrosion

Build Status Documentation License

Corrosion, formerly known as cmake-cargo, is a tool for integrating Rust into an existing CMake project. Corrosion can automatically import executables, static libraries, and dynamic libraries from a workspace or package manifest (Cargo.toml file).

Features

  • Automatic Import of Executable, Static, and Shared Libraries from Rust Crate
  • Easy Installation of Rust Executables
  • Trivially Link Rust Executables to C/C++ Libraries in Tree
  • Multi-Config Generator Support
  • Simple Cross-Compilation

Sample Usage with FetchContent

Using the CMake FetchContent module allows you to easily integrate corrosion into your build. Other methods including installing corrosion or adding it as a subdirectory are covered in the setup chapter of the corrosion documentation.

include(FetchContent)

FetchContent_Declare(
    Corrosion
    GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
    GIT_TAG v0.3 # Optionally specify a commit hash, version tag or branch here
)
FetchContent_MakeAvailable(Corrosion)

# Import targets defined in a package or workspace manifest `Cargo.toml` file
corrosion_import_crate(MANIFEST_PATH rust-lib/Cargo.toml)

add_executable(your_cpp_bin main.cpp)
target_link_libraries(your_cpp_bin PUBLIC rust-lib)

More Repositories

1

km-stl

A drop-in replacement for the C++ STL for kernel mode Windows drivers. The goal is to have implementations for things like the standard algorithms that don't require memory allocations or exceptions, and for implementations of type traits and other compile-time related headers. Full implementation of the STL is a non-goal.
C++
30
star
2

rust-plugin-example

An example of implementing a plugin model in Rust
Rust
20
star
3

cargo-mpirun

A cargo extension similar to "cargo run" that runs the target program with mpiexec.
Rust
13
star
4

Steam-Management-for-PowerShell

This is a PowerShell module which helps you manage Steam games by offering the ability to move games to other locations in your file system, such as from your HDD to your SSD.
PowerShell
12
star
5

ktl

A template programming library for Kernel Mode Windows drivers.
C++
9
star
6

Async-Await-Proposal-for-TypeScript

A specification for how async await should work in TypeScript.
JavaScript
7
star
7

wtl

Helper functions for using Windows APIs with modern C++.
C++
7
star
8

node-rs

Rust bindings for node.js using stdweb
Rust
4
star
9

typeify

Module for compiling Typescript using browserify.
TypeScript
3
star
10

AGStopwatch

Because I'm tired of writing these 5 lines of code over and over.
TypeScript
3
star
11

X-Marquee

Marquees in HTML5
3
star
12

azure-tables-promises

This turns the Azure Table node.js function calls to standard Promises.
JavaScript
2
star
13

Roots

Implementation of root finding algorithms using bisection, Newton's method, and the Secant method
F#
2
star
14

Podcasts

A Universal Windows App for podcasts
C#
2
star
15

chroma-rust

Razer Chroma SDK for Rust
Rust
2
star
16

PoshVSTS

A PowerShell module for inteacting with Visual Studio Online
PowerShell
2
star
17

Git.PS

Provides higher level PowerShell Cmdlets for interacting with git. Not exhaustive - new functionality is added as the author needs it.
PowerShell
2
star
18

CoinbaseAPI.NET

A .NET Portable Class Library for easily interacting with the Coinbase API. Works on Android, iOS, Windows Phone Silverlight, Windows Runtime (PC and Phone), and on the .NET Framework.
C#
2
star
19

bellmanford

An implementation of the Bellman-Ford algorithm in TypeScript.
TypeScript
1
star
20

fls

Fortran Language Service
Rust
1
star
21

AGMathJS

This is a basic math library written in JavaScript.
JavaScript
1
star
22

OSR-Learning-Kit-Universal-WDF-Driver

A universal WDF driver for the OSR USB-FX-2 Learning Kit
C++
1
star
23

AccentResources

This project provides Xaml-reference-able resources for accent colors in Windows UWAs.
C#
1
star
24

estimate-pi

Simple Rust program for estimating PI using MPI and rayon
Rust
1
star
25

TypedPromises

Promises implemented in TypeScript conforming to http://promises-aplus.github.io/promises-spec/
TypeScript
1
star
26

cpp-auto-formatter

A GitHub Action for formatting C and C++ code.
Rust
1
star
27

pngs

A rust library for reading, decoding, and encoding pngs.
Rust
1
star