Skip to content

A Rust wrapper of the conan C/C++ package manager (conan.io) to simplify usage in build scripts

License

Notifications You must be signed in to change notification settings

taco-paco/conan-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
    }
}

About

A Rust wrapper of the conan C/C++ package manager (conan.io) to simplify usage in build scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%