https://github.com/yourarj/rust-from-cpp
This project aims to experiment integrating RUST in C++ project
https://github.com/yourarj/rust-from-cpp
cpp cxx rust
Last synced: 2 months ago
JSON representation
This project aims to experiment integrating RUST in C++ project
- Host: GitHub
- URL: https://github.com/yourarj/rust-from-cpp
- Owner: yourarj
- License: mit
- Created: 2022-12-10T08:11:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T08:14:18.000Z (over 3 years ago)
- Last Synced: 2025-07-19T18:01:28.354Z (12 months ago)
- Topics: cpp, cxx, rust
- Language: C++
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rust-from-cpp
This project aims to experiment integrating rust in C++ project
## Setup (Optional)
Considering Ubuntu
`sudo apt install clang lldb llvm lld`
## Pre-requisites
If you are running with `-DENABLE_LTO=ON` switch, make sure that two environment variables `CC=clang-14` and `CXX=clang++-14` are set according to available clang version.
Rust llvm and local llvm should have same version.
## How to Build & Run
```bash
# install cmake
sudo apt install cmake
# assuming running these commands from project root
# create build dir
mkdir -p build
# cd to build dir
cd build
# build with cross-language LTO off
cmake -DENABLE_LTO=OFF -DCMAKE_BUILD_TYPE=Release ..
# make
make -j
# run executable
./main
```