A basic template to create a library in Rust that can be directly used in C/C++.
RustCProject is a template repository for creating libraries in Rust that can be used in C and C++ projects. It provides a basic setup that includes Rust, Shell, C++, and CMake configurations.
- Rust: Install Rust
- CMake: Install CMake
- C/C++ compiler: Ensure you have a compatible C/C++ compiler installed
To build the project, you can use the compil.sh
script provided in the repository. This script handles building the Rust library, copying the necessary files, and compiling the C++ project.
-
Clone the repository:
git clone https://github.com/MoutOgm/RustCProject.git cd RustCProject
-
Run the build script:
./compil.sh
-
To execute the compiled program, use:
./compil.sh run
To duplicate a library from the build-cxx
repository with minimal history, you can clone it using:
git clone --depth 1 https://github.com/username/build-cxx.git
This command will clone only the latest snapshot of the build-cxx
repository.