File: build.rs

package info (click to toggle)
rust-derive-deftly 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,652 kB
  • sloc: perl: 1,032; sh: 373; python: 227; makefile: 11
file content (24 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// build.rs for derive-deftly-macros

// We recompile some of our macro code in tests, with cargo
// features that aren't declared in the package's Cargo.toml.
// And, we have a nonstandard RUSTFLAGS --cfg=derive_deftly_dprint
// for debugging output.
//
// Here, we tell rustc, via cargo, that these are all allowed.
//
// Another effect is that this build.rs file
// causes OUT_DIR to be available in `check.rs`.

// This is a subset of tests/build.rs, written to be as minimal
// (and fast to compile) as possible.

fn main() {
    // We must use deprecated single colon `cargo:rustc...` syntax,
    // because otherwise cargo thinks we're violating our MSRV.
    //  https://github.com/rust-lang/cargo/issues/14147
    println!(
        r#"cargo:rustc-check-cfg=cfg(derive_deftly_dprint)
cargo:rustc-check-cfg=cfg(feature, values("bizarre"))"#
    );
}