Skip to content

Per crate build target in workspace #7004

Closed
@jonblack

Description

@jonblack

Describe the problem you are trying to solve

I have a project with two crates in a workspace. The first crate should compile to asmjs with --target asmjs-unknown-emscripten and the result is used in the second crate, which should compile to the native binary format (default target).

When I run cargo build in the root crate that contains the workspace configuration in Cargo.toml, it builds both crates using the default target.

Describe the solution you'd like

I'd like to be able to specify the target for each crate. I'm not sure if this belongs in each crates' Cargo.toml or in the root crate's Cargo.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsA-cross-compilingArea: using --target flag for other platformsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions