Skip to content

build_self_cdylib depends on order of crate-type #4

@AnHeuermann

Description

@AnHeuermann

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions