-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationA-profilesArea: profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix
Description
Problem
cargo is great for simple projects, but for more complex (eg. multi-language) projects, it is often desirable to use cargo in addition to a more general build system, such as make.
however, the way cargo outputs build directories is often difficult to configure via make, usually resulting in people writing their makefiles in a way that only works with --release
Proposed Solution
if this was implemented, configuring builds would be as simple as:
profile = debug
bin = target/$(profile)/myprogram
$(bin): src/main.rs Cargo.toml
cargo build --profile $(profile)
and then you could call either make profile=release
or make profile=debug
Notes
this already works fine for profile=release, but it throws an error when you try to build it with less optimizations:
cargo build --profile debug
error: profile name `debug` is reserved
To configure the default development profile, use the name `dev` as in [profile.dev]
See https://doc.rust-lang.org/cargo/reference/profiles.html for more on configuring profiles.
Metadata
Metadata
Assignees
Labels
A-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationA-profilesArea: profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fixStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix