Reputation: 1925
I'd like to build my rust app with "dev" profile, but some of the dependencies with "release" profile (because otherwise they are really slow). How can I selectively specify profiles for my crate dependencies?
Upvotes: 10
Views: 5334
Reputation: 8793
Cargo is able to override profile for a specific package.
From the reference :
Profile settings can be overridden for specific packages and build-time crates. To override the settings for a specific package, use the package table to change the settings for the named package:
# The `foo` package will use the -Copt-level=3 flag. [profile.dev.package.foo] opt-level = 3
While compiling with dev
profile, this will override optimize level for foo
package.
dev
profile and more from a release
profile:#override target package to build with dev default(opt-level)
[profile.dev.package.bar]
opt-level = 0
#override all other dependencies to build with release default(opt-level)
[profile.dev.package."*"]
opt-level = 3
[profile.dev.package."*"]
opt-level = 3
See also :
Upvotes: 23