16050
|
1 |
## About Corrosion
|
|
2 |
|
|
3 |
Corrosion, formerly known as cmake-cargo, is a tool for integrating Rust into an existing CMake
|
|
4 |
project. Corrosion is capable of automatically importing executables, static libraries, and
|
|
5 |
dynamic libraries from a Rust package or workspace as CMake targets.
|
|
6 |
|
|
7 |
The imported static and dynamic library types can be linked into C/C++ CMake targets using the usual
|
|
8 |
CMake functions such as [`target_link_libraries()`].
|
|
9 |
For rust executables and dynamic libraries corrosion provides a `corrosion_link_libraries`
|
|
10 |
helper function to conveniently add the necessary flags to link C/C++ libraries into
|
|
11 |
the rust target.
|
|
12 |
|
16067
|
13 |
## Requirements
|
|
14 |
|
|
15 |
- Corrosion supports CMake 3.15 and newer with the v0.5 release. If you are using the v0.5 release, please
|
|
16 |
view [the documentation here](./v0.5/introduction.md)
|
|
17 |
- The master branch of Corrosion currently requires CMake 3.22 or newer.
|
16050
|
18 |
|
|
19 |
[`target_link_libraries()`]: https://cmake.org/cmake/help/latest/command/target_link_libraries.html
|