Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #786 - nabijaczleweli:feat/783-no_cargo, r=kbknapp
Add no_cargo feature to disable Cargo-env-var-dependent macros For example, given: ```toml clap = { path = "t:/clap-rs" } ``` The macros `crate_version!()` and `crate_authors!()` exist, so the crate compiles without errors: ``` Compiling https v0.2.0 (file:///P:/Rust/http) Finished debug [unoptimized + debuginfo] target(s) in 6.93 secs Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs [Finished in 7.5s] ``` But, adding the `no_cargo` feature: ```toml clap = { path = "t:/clap-rs", features = ["no_cargo"] } ``` The macros are removed, so the crate fails to compile: ``` Compiling clap v2.19.2 (file:///T:/clap-rs) Compiling https v0.2.0 (file:///P:/Rust/http) error: macro undefined: 'crate_version!' --> src\options.rs:40:22 | 40 | .version(crate_version!()) | ^^^^^^^^^^^^^ error: macro undefined: 'crate_authors!' --> src\options.rs:41:21 | 41 | .author(crate_authors!()) | ^^^^^^^^^^^^^ error: aborting due to 2 previous errors error: Could not compile `https`. ``` Closes #783
- Loading branch information