5 releases
0.2.0 | Jun 2, 2020 |
---|---|
0.1.3 | Dec 10, 2019 |
0.1.2 | May 25, 2019 |
0.1.1 | May 24, 2019 |
0.1.0 | May 22, 2019 |
#144 in Build Utils
258 downloads per month
19KB
462 lines
conan-rs
A Rust wrapper of the conan C/C++ package manager (conan.io) to simplify usage in build scripts.
# Cargo.toml
[build-dependencies]
conan = "0.1"
The conan executable is assumed to be conan
unless the CONAN
environment variable is set.
extern crate conan;
use conan::*;
fn main() {
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let conan_profile = format!("{}-{}", target_os, target_arch);
let command = InstallCommandBuilder::new()
.with_profile(&conan_profile)
.build_policy(BuildPolicy::Missing)
.recipe_path(Path::new("conanfile.txt"))
.build();
if let Some(build_info) = command.generate() {
println!("using conan build info");
build_info.cargo_emit();
return;
}
}
Dependencies
~2–3MB
~80K SLoC