-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-featuresArea: features — conditional compilationArea: features — conditional compilation
Description
It would be useful to be able to depend on the same package twice, but using different features, that is, being able to write something like:
[dependencies.some_library]
git = "fixme"
features = [ "feature1" ]
[dependencies.some_library]
git = "fixme"
features = [ "feature2" ]However, this will cause some naming problems as the two libraries will have the same name. To prevent this, we could add a name entry to the depencency to rename it:
[dependencies.some_library]
git = "fixme"
name = "some_library_1"
features = [ "feature1" ]
[dependencies.some_library]
git = "fixme"
name = "some_library_2"
features = [ "feature2" ]Or perhaps we could let the user specify the features when he does an extern crate:
extern crate "some_library" with feature1 as some_library_1
extern crate "some_library" with feature2 as some_library_2and the dependency on cargo would not specify any feature as they will be inferred by the extern crate:
[dependencies.some_library]
git = "fixme"My use-case for this is to allow the user to use the 3df32 feature of ncollide (for 3d collision detection) together with the 2df32 feature (for 2d collision detection) in the same application.
schneiderfelipe and raviqqe
Metadata
Metadata
Assignees
Labels
A-featuresArea: features — conditional compilationArea: features — conditional compilation