Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfg parameters for dependencies #137

Closed
trevex opened this issue Jul 7, 2014 · 6 comments
Closed

cfg parameters for dependencies #137

trevex opened this issue Jul 7, 2014 · 6 comments

Comments

@trevex
Copy link

trevex commented Jul 7, 2014

I started using cargo recently and noticed that I am unable to pass cfg parameters to dependencies. Although this might be a fairly rare use-case it would help to configure dependencies, i.e.
imagine an ORM for mysql, a use case for cfg would be to specify the mysql connector (Sun Connector, libmysqlclient, libdrizzle), where multiple are available.
In an application using the ORM library, it might be desired to pick the mysql client library.

Therefore it would be nice to be able to specify cfg parameters

[dependencies.*]
cfg = "USE_DRIZZLE"
@alexcrichton
Copy link
Member

This is definitely planned! There will be support for a package to expose a number of features which can be selected upon and each feature will be able to pass flags to the compiler.

@trevex
Copy link
Author

trevex commented Jul 7, 2014

Good to hear 👍

@trevex trevex closed this as completed Jul 7, 2014
@huonw
Copy link
Member

huonw commented Jul 7, 2014

(Just being planned doesn't mean this shouldn't be open. :) )

@huonw huonw reopened this Jul 7, 2014
@wycats wycats added the planned label Jul 8, 2014
@rail44
Copy link

rail44 commented Aug 4, 2014

Is it going to come with [[bin]] section?
I mean, is

[[bin]]
name = "foo"
cfg = "bar"

allowed?

@metajack
Copy link

This is blocking a Servo move to Cargo. Specifically rust-alert has conditional dependencies for some platforms. On OS X it needs rust-cocoa and rust-core-foundation, but has no dependencies on Linux.

https://github.com/servo/rust-alert

@alexcrichton
Copy link
Member

I believe this is now aptly covered by #385, so I'm going to close this in favor of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants