3 releases

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

#228 in Build Utils

Download history 34026/week @ 2024-07-23 24312/week @ 2024-07-30 7445/week @ 2024-08-06 6368/week @ 2024-08-13 10218/week @ 2024-08-20 8348/week @ 2024-08-27 9421/week @ 2024-09-03 11092/week @ 2024-09-10 7825/week @ 2024-09-17 6595/week @ 2024-09-24 11142/week @ 2024-10-01 8911/week @ 2024-10-08 7691/week @ 2024-10-15 9655/week @ 2024-10-22 7663/week @ 2024-10-29 12236/week @ 2024-11-05

39,032 downloads per month
Used in 18 crates (9 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.2–3MB
~55K SLoC