diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2022-12-19 10:27:20 +0100 |
---|---|---|
committer | Jeff Vander Stoep <jeffv@google.com> | 2022-12-19 10:29:49 +0100 |
commit | 9b675bea75ecaded550c274361e649d7064f06e9 (patch) | |
tree | 9db7f5b9aee709a192b43be05d67744983fe9a75 /build.rs | |
parent | 855d8f3aed2839e32c08abccc93cc9c3b1f68ba9 (diff) | |
download | slab-9b675bea75ecaded550c274361e649d7064f06e9.tar.gz |
Upgrade slab to 0.4.7main-16k-with-phones
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update rust/crates/slab
For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
Test: TreeHugger
Change-Id: I2a05eaa50dfb3ee4d9c3d243c1c26e99614e46ce
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..b60351a --- /dev/null +++ b/build.rs @@ -0,0 +1,24 @@ +fn main() { + let cfg = match autocfg::AutoCfg::new() { + Ok(cfg) => cfg, + Err(e) => { + // If we couldn't detect the compiler version and features, just + // print a warning. This isn't a fatal error: we can still build + // Slab, we just can't enable cfgs automatically. + println!( + "cargo:warning=slab: failed to detect compiler features: {}", + e + ); + return; + } + }; + // Note that this is `no_`*, not `has_*`. This allows treating as the latest + // stable rustc is used when the build script doesn't run. This is useful + // for non-cargo build systems that don't run the build script. + if !cfg.probe_rustc_version(1, 39) { + println!("cargo:rustc-cfg=slab_no_const_vec_new"); + } + if !cfg.probe_rustc_version(1, 46) { + println!("cargo:rustc-cfg=slab_no_track_caller"); + } +} |