I have a package that builds multiple crate types:
[lib]
crate-type = ["staticlib", "cdylib", "lib"]
One of my tests is calling build_current_project to build the cdylib crate, but the static C library is build instead.
fn omc_test() {
let dylib_path = test_cdylib::build_current_project();
println!("library: {:?}", dylib_path);
}
I changed the order of crate-type in Cargo.toml to fix my test. Is there a way to only build the cdylib crate without changing the Cargo.toml?
I have a package that builds multiple crate types:
One of my tests is calling
build_current_projectto build thecdylibcrate, but the static C library is build instead.I changed the order of
crate-typeinCargo.tomlto fix my test. Is there a way to only build thecdylibcrate without changing theCargo.toml?