{"id":18728809,"url":"https://github.com/rubyonworld/clang-sys","last_synced_at":"2025-11-12T05:30:20.233Z","repository":{"id":174007881,"uuid":"533346191","full_name":"RubyOnWorld/clang-sys","owner":"RubyOnWorld","description":"Note that the documentation on https://docs.rs for this crate assumes usage of the runtime Cargo feature as well as the Cargo feature for the latest supported version of libclang (e.g., clang_13_0), neither of which are enabled by default.","archived":false,"fork":false,"pushed_at":"2022-09-13T21:58:41.000Z","size":464,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T14:26:44.292Z","etag":null,"topics":["clang","rust","sys"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-06T13:50:24.000Z","updated_at":"2022-09-27T22:28:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"6023df39-e982-469f-9b8e-1e4e9b0ffc91","html_url":"https://github.com/RubyOnWorld/clang-sys","commit_stats":null,"previous_names":["rubyonworld/clang-sys"],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fclang-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fclang-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fclang-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fclang-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/clang-sys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599040,"owners_count":19665911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","rust","sys"],"created_at":"2024-11-07T14:24:26.033Z","updated_at":"2025-11-12T05:30:20.187Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clang-sys\n\n[![Crate](https://img.shields.io/crates/v/clang-sys.svg)](https://crates.io/crates/clang-sys)\n[![Documentation](https://docs.rs/clang-sys/badge.svg)](https://docs.rs/clang-sys)\n[![CI](https://img.shields.io/github/workflow/status/KyleMayes/clang-sys/CI/master)](https://github.com/KyleMayes/vulkanalia/actions?query=workflow%3ACI)\n![MSRV](https://img.shields.io/badge/MSRV-1.40.0-blue)\n\nRust bindings for `libclang`.\n\nIf you are interested in a somewhat idiomatic Rust wrapper for these bindings, see [`clang-rs`](https://github.com/KyleMayes/clang-rs).\n\nReleased under the Apache License 2.0.\n\n## [Documentation](https://docs.rs/clang-sys)\n\nNote that the documentation on https://docs.rs for this crate assumes usage of the `runtime` Cargo feature as well as the Cargo feature for the latest supported version of `libclang` (e.g., `clang_13_0`), neither of which are enabled by default.\n\nDue to the usage of the `runtime` Cargo feature, this documentation will contain some additional types and functions to manage a dynamically loaded `libclang` instance at runtime.\n\nDue to the usage of the Cargo feature for the latest supported version of `libclang`, this documentation will contain constants and functions that are not available in the oldest supported version of `libclang` (3.5). All of these types and functions have a documentation comment which specifies the minimum `libclang` version required to use the item.\n\n## Supported Versions\n\nTo target a version of `libclang`, enable a Cargo features such as one of the following:\n\n* `clang_3_5` - requires `libclang` 3.5 or later\n* `clang_3_6` - requires `libclang` 3.6 or later\n* etc...\n* `clang_12_0` - requires `libclang` 12.0 or later\n* `clang_13_0` - requires `libclang` 13.0 or later\n\nIf you do not enable one of these features, the API provided by `libclang` 3.5 will be available by default.\n\n## Dependencies\n\nBy default, this crate will attempt to link to `libclang` dynamically. In this case, this crate depends on the `libclang` shared library (`libclang.so` on Linux, `libclang.dylib` on macOS, `libclang.dll` on Windows). If you want to link to `libclang` statically instead, enable the `static` Cargo feature. In this case, this crate depends on the LLVM and Clang static libraries. If you don't want to link to `libclang` at compiletime but instead want to load it at runtime, enable the `runtime` Cargo feature.\n\nThese libraries can be either be installed as a part of Clang or downloaded [here](http://llvm.org/releases/download.html).\n\n**Note:** The downloads for LLVM and Clang 3.8 and later do not include the `libclang.a` static library. This means you cannot link to any of these versions of `libclang` statically unless you build it from source.\n\n### Versioned Dependencies\n\nThis crate supports finding versioned instances of `libclang.so` (e.g.,`libclang-3.9.so`). In the case where there are multiple instances to choose from, this crate will prefer instances with higher versions. For example, the following instances of `libclang.so` are listed in descending order of preference:\n\n1. `libclang-4.0.so`\n2. `libclang-4.so`\n3. `libclang-3.9.so`\n4. `libclang-3.so`\n5. `libclang.so`\n\n**Note:** On BSD distributions, versioned instances of `libclang.so` matching the pattern `libclang.so.*` (e.g., `libclang.so.7.0`) are also included.\n\n**Note:** On Linux distributions when the `runtime` features is enabled, versioned instances of `libclang.so` matching the pattern `libclang.so.*` (e.g., `libclang.so.1`) are also included.\n\n## Environment Variables\n\nThe following environment variables, if set, are used by this crate to find the required libraries and executables:\n\n* `LLVM_CONFIG_PATH` **(compiletime)** - provides a full path to an `llvm-config` executable (including the executable itself [i.e., `/usr/local/bin/llvm-config-8.0`])\n* `LIBCLANG_PATH` **(compiletime)** - provides a path to a directory containing a `libclang` shared library or a full path to a specific `libclang` shared library\n* `LIBCLANG_STATIC_PATH` **(compiletime)** - provides a path to a directory containing LLVM and Clang static libraries\n* `CLANG_PATH` **(runtime)** - provides a path to a `clang` executable\n\n## Linking\n\n### Dynamic\n\n`libclang` shared libraries will be searched for in the following directories:\n\n* the directory provided by the `LIBCLANG_PATH` environment variable\n* the `bin` and `lib` directories in the directory provided by `llvm-config --libdir`\n* the directories provided by `LD_LIBRARY_PATH` environment variable\n* a list of likely directories for the target platform (e.g., `/usr/local/lib` on Linux)\n* **macOS only:** the toolchain directory in the directory provided by `xcode-select --print-path`\n\nOn Linux, running an executable that has been dynamically linked to `libclang` may require you to add a path to `libclang.so` to the `LD_LIBRARY_PATH` environment variable. The same is true on OS X, except the `DYLD_LIBRARY_PATH` environment variable is used instead.\n\nOn Windows, running an executable that has been dynamically linked to `libclang` requires that `libclang.dll` can be found by the executable at runtime. See [here](https://msdn.microsoft.com/en-us/library/7d83bc18.aspx) for more information.\n\n### Static\n\nThe availability of `llvm-config` is not optional for static linking. Ensure that an instance of this executable can be found on your system's path or set the `LLVM_CONFIG_PATH` environment variable. The required LLVM and Clang static libraries will be searched for in the same way as shared libraries are searched for, except the `LIBCLANG_STATIC_PATH` environment variable is used in place of the `LIBCLANG_PATH` environment variable.\n\n### Runtime\n\nThe `clang_sys::load` function is used to load a `libclang` shared library for use in the thread in which it is called. The `clang_sys::unload` function will unload the `libclang` shared library. `clang_sys::load` searches for a `libclang` shared library in the same way one is searched for when linking to `libclang` dynamically at compiletime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fclang-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fclang-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fclang-sys/lists"}