If there are two libraries, how do you select only one to build if you don’t want both?
- Build only
extern crateed library
Encouraging separate projects for each crate means dependencies are generally more re-usable than if they were bundled together. Crates which want to provide multiple libraries almost always end up getting large enough that they should be separated anyway as well.
name = “peg_syntax_ext”
With multiple libraries in one package there would need to be a method of specifying dependencies amongst them.
- Proposal usage:
#![plugin(plugin1)] extern crate lib1; extern crate lib2;
- OR limit max one ‘runtime library’ per crate,
A number of features have been added after-the-fact which have made multiple libraries tricky. For example, if a package has a build script, how does it know which crate to link the native libraries into?
- By using ‘build’ attribute in ‘lib’ & ‘bin’?
- But as this can break project structure, maybe ‘/build_src/scriptname.rs’?