3 releases

0.1.2 Mar 24, 2021
0.1.1 Mar 24, 2021
0.1.0 Mar 24, 2021

#191 in Build Utils

Download history 8807/week @ 2024-09-02 10293/week @ 2024-09-09 8570/week @ 2024-09-16 5375/week @ 2024-09-23 12597/week @ 2024-09-30 8333/week @ 2024-10-07 7804/week @ 2024-10-14 9709/week @ 2024-10-21 7732/week @ 2024-10-28 12723/week @ 2024-11-04 10415/week @ 2024-11-11 9499/week @ 2024-11-18 8168/week @ 2024-11-25 7988/week @ 2024-12-02 8156/week @ 2024-12-09 9537/week @ 2024-12-16

34,137 downloads per month
Used in 20 crates (11 directly)

Apache-2.0

5KB
74 lines

glibc_version

Crate to help rust projects discover GNU libc version at build time. Expected to be used in build.rs.

Usage

let ver = glibc_version::get_version().unwrap();
println!("glic version: {}.{}", ver.major, ver.minor);

lib.rs:

Crate to help rust projects discover GNU libc version at build time. Expected to be used in build.rs. Note that this crate is only expected to work under cfg(target_env = "gnu"), so please guard the usage under relevant configuration predicates.

Example

let ver = glibc_version::get_version().unwrap();
if ver.major >= 2 && ver.minor >= 28 {
   println!("cargo:rustc-cfg=glibc_renameat2");
}

Dependencies

~2–3MB
~53K SLoC