Skip to content

Commit 5e9ac4b

Browse files
committed
Remove now unnecessary local-only build.rs example for check-cfg
1 parent 980afaa commit 5e9ac4b

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/doc/src/reference/build-scripts.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -292,32 +292,6 @@ if foo_bar_condition {
292292
}
293293
```
294294

295-
##### Example of local-only `build.rs`/build script
296-
297-
Build scripts can impose costs on downstream users, and crate authors who wish to avoid
298-
this can use "local-only" build scripts, which are active locally but not packaged in the
299-
distributed package. Completly removing the cost from downstream users.
300-
301-
The way to achieved this, is by excluding the `build.rs` in the `Cargo.toml` with the
302-
`exclude` key:
303-
304-
```diff
305-
[package]
306-
name = "foo"
307-
version = "0.1.0"
308-
+ exclude = ["build.rs"]
309-
```
310-
311-
*`build.rs`:*
312-
```rust
313-
fn main() {
314-
// Warning: build.rs is not published to crates.io.
315-
316-
println!("cargo::rerun-if-changed=build.rs");
317-
println!("cargo::rustc-check-cfg=cfg(foo)");
318-
}
319-
```
320-
321295
For a more complete example see in the [build script examples][build-script-examples] page
322296
the [conditional compilation][conditional-compilation-example] example.
323297

0 commit comments

Comments
 (0)