libclangclang-rs(https://github.com/KyleMayes/clang-rs)runtime Cargo feature, latest supported version of libclang(e.g., clang_13_0)을 사용한다고 가정하고 있으며, 기본적으로 둘 다 활성화되어 있지 않다.runtime Cargo feature의 사용으로 인해, 이 문서는 런타임에 dinamically loaded libclang을 manage하기위한 추가적인 type, function를 포함한다.libclang의 최신 버전을 지원한다. 이 문서는 oldest supported version libclang(3.5)의 constant와 function이 사용할 수 없다. 이 문서의 주석으로된 모든 type과 function는 명시된 libclang 버전의 minimum이 필요로한다.libclang의 타겟 버전, enable a Cargo features such as one of the following:clang_3_5 - requires libclang 3.5 or laterclang_3_6 - requires libclang 3.6 or laterclang_12_0 - requires libclang 12.0 or laterclang_13_0 - requires libclang 13.0 or laterlibclang 3.5로 default 제공된다.libclang을 다이나믹 링크하도록 시도한다.libclang(libclang.so: shared library)에 Dependslibclang을 static 링크 하고 싶다면, Cargo feature에서, static을 enable하라.static library를 Depends한다.libclang 링크를 compile time에 원하지 않고 runtime에서 enable하길 원한다면, Cargo feature에서 runtime을 enable하라.libclang.so의 versioned instance (e.g., libclang-3.9.so)를 찾는데 지원한다.libclang.so의 인스턴스가 아래와 같이 있다면, 아래 순으로 선호된다.libclang-4.0.solibclang-4.solibclang-3.9.solibclang-3.solibclang.solibclang.so의 versioned instance는 libclang.so.*로 패턴 매칭된다.libclang.so.7.0libclang.so의 versioned instance는 libclang.so.*로 패턴 매칭된다.libclang.so.1LLVM_CONFIG_PATH(compiletime): llvm-config에 full path를 제공한다./usr/local/bin/llvm-config-8.0LIBCLANG_PATH(compiletime): libclang의 shared library 를 포함하는 디렉토리의 full path to specific libclang shared libraryLIBCLANG_STATIC_PATH(compiletime): LLVM과 Clang Static Library를 포함하는 디렉토리의 full pathCLANG_PATH(runtime): 실행가능한 clang의 path를 제공libclang shared library는 아래의 디렉토리를 찾는다.LIBCLANG_PATH 디렉토리llvm-config --libdir에 의해 제공되는 bin, lib 디렉토리LD_LIBRARY_PATH 디렉토리/usr/local/lib on Linux)xcode-select --print-pathlibclang may require you to add a path to libclang.so to the LD_LIBRARY_PATH environment variable. OS X에서도 마찬가지. DYLD_LIBRARY_PATH가 대신 사용되는 것을 제외하곤,The 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.
The 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.