Properly define freebsd11 attribute

This commit is contained in:
Luca Pizzamiglio 2019-07-21 18:10:40 +02:00
parent c2c62cc8a4
commit 72aa2262ca
2 changed files with 9 additions and 9 deletions

View File

@ -16,6 +16,9 @@ fn main() {
}
if env::var("LIBC_CI").is_ok() {
if let Some(11) = which_freebsd() {
println!("cargo:rustc-cfg=freebsd11");
}
if let Some(12) = which_freebsd() {
println!("cargo:rustc-cfg=freebsd12");
}

View File

@ -1450,15 +1450,12 @@ fn test_freebsd(target: &str) {
let freebsd_ver = which_freebsd();
if let Some(12) = freebsd_ver {
// If the host is FreeBSD 12, run FreeBSD 12 tests
cfg.cfg("freebsd12", None);
}
if let Some(13) = freebsd_ver {
// If the host is FreeBSD 12, run FreeBSD 12 tests
cfg.cfg("freebsd13", None);
}
match freebsd_ver {
Some(11) => cfg.cfg("freebsd11", None),
Some(12) => cfg.cfg("freebsd12", None),
Some(13) => cfg.cfg("freebsd13", None),
_ => &mut cfg
};
// Required for `getline`:
cfg.define("_WITH_GETLINE", None);