//! Finds `libclang` static or shared libraries and links to them. //! //! # Environment Variables //! //! This build script can make use of several environment variables to help it //! find the required static or shared libraries. //! //! * `LLVM_CONFIG_PATH` - provides a path to an `llvm-config` executable //! * `LIBCLANG_PATH` - provides a path to a directory containing a `libclang` //! shared library or a path to a specific `libclang` shared library //! * `LIBCLANG_STATIC_PATH` - provides a path to a directory containing LLVM //! and Clang static libraries
/// Copies the code used to find and link to `libclang` shared libraries into /// the build output directory so that it may be used when linking at runtime. #[cfg(feature = "runtime")] fn main() { use std::env;
if cfg!(feature = "static") {
panic!("`runtime` and `static` features can't be combined");
}
let out = env::var("OUT_DIR").unwrap();
copy("build/macros.rs", &Path::new(&out).join("macros.rs"));
copy("build/common.rs", &Path::new(&out).join("common.rs"));
copy("build/dynamic.rs", &Path::new(&out).join("dynamic.rs"));
}
/// Finds and links to the required libraries dynamically or statically. #[cfg(not(feature = "runtime"))] fn main() { if cfg!(feature = "static") {
r#static::link();
} else {
dynamic::link();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.