A light-weight wrapper for Ruby exposing libclang. Works for libclang v3.4+.
Add this line to your application's Gemfile:
gem 'ffi-clang'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ffi-clang
Please see the project documentation for more details.
The following environment variables can be used to configure how ffi-clang finds libclang and its resources:
| Variable | Description |
|---|---|
LLVM_CONFIG |
Path to the llvm-config binary. Used to locate the libclang shared library and clang binary. |
LLVM_VERSION |
Target LLVM version (e.g., 3.4). When set, disables auto-detection of llvm-config. |
LIBCLANG |
Direct path to the libclang shared library (e.g., /usr/lib/libclang.so). Overrides llvm-config based library discovery. |
LIBCLANG_RESOURCE_DIR |
Path to the clang resource directory containing compiler-intrinsic headers (stddef.h, stdarg.h, etc.). Use this if libclang cannot find its own headers. |
For example, to use a specific LLVM installation:
LLVM_CONFIG=llvm-config-mp-3.4 bundle exec bake test
Please see the project releases for all releases.
We welcome contributions to this project.
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin my-new-feature). - Create new Pull Request.
In order to protect users of this project, we require all contributors to comply with the Developer Certificate of Origin. This ensures that all contributions are properly licensed and attributed.
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.