https://github.com/pointcloudlibrary/clang-bind
Generate bindings for C++ code using clang (python bindings) and pybind11
https://github.com/pointcloudlibrary/clang-bind
autogenerate bindings cpp hacktoberfest pybind11 python
Last synced: 8 months ago
JSON representation
Generate bindings for C++ code using clang (python bindings) and pybind11
- Host: GitHub
- URL: https://github.com/pointcloudlibrary/clang-bind
- Owner: PointCloudLibrary
- Created: 2020-09-26T13:21:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-30T21:10:35.000Z (over 4 years ago)
- Last Synced: 2025-06-14T04:06:13.083Z (8 months ago)
- Topics: autogenerate, bindings, cpp, hacktoberfest, pybind11, python
- Language: Python
- Homepage:
- Size: 339 KB
- Stars: 10
- Watchers: 13
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Description
The clang-bind is a project to generate python bindings for C++ code using clang python bindings and pybind11.
# Dependencies
**C++**
*libclang*
```
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main' | sudo tee -a /etc/apt/sources.list
echo 'deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main' | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y libclang-11-dev python3-clang-11
```
**Python**
`pip install -r requirements.txt`
# Demonstration
1. Go to `tests/test_project/` folder
2. Create a build folder
3. Run `cmake ..`
4. Run `make -j$(nproc)`
5. Run `python ../../../clang_bind/parse.py --com ./ ../src/simple.cpp`
6. Run `python ../../../clang_bind/generate.py --com json/src/simple.json`
The binding code will be available in `pybind11-gen/src` folder.