mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-14 21:16:50 +00:00
Don't link against advapi32, except on win7.
This commit is contained in:
parent
79b43dfde9
commit
9278a3ebd6
@ -34,7 +34,7 @@ pub macro link {
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "windows_raw_dylib"))]
|
||||
#[link(name = "advapi32")]
|
||||
#[cfg_attr(target_vendor = "win7", link(name = "advapi32"))]
|
||||
#[link(name = "ntdll")]
|
||||
#[link(name = "userenv")]
|
||||
#[link(name = "ws2_32")]
|
||||
|
@ -232,7 +232,6 @@ fn make_win_dist(
|
||||
"libpthread.a",
|
||||
//Windows import libs
|
||||
//This should contain only the set of libraries necessary to link the standard library.
|
||||
"libadvapi32.a",
|
||||
"libbcrypt.a",
|
||||
"libcomctl32.a",
|
||||
"libcomdlg32.a",
|
||||
|
@ -1,17 +1,15 @@
|
||||
use crate::{is_msvc, is_windows, uname};
|
||||
use crate::{is_msvc, is_win7, is_windows, uname};
|
||||
|
||||
/// `EXTRACFLAGS`
|
||||
pub fn extra_c_flags() -> Vec<&'static str> {
|
||||
if is_windows() {
|
||||
if is_msvc() {
|
||||
vec![
|
||||
"ws2_32.lib",
|
||||
"userenv.lib",
|
||||
"advapi32.lib",
|
||||
"bcrypt.lib",
|
||||
"ntdll.lib",
|
||||
"synchronization.lib",
|
||||
]
|
||||
let mut libs =
|
||||
vec!["ws2_32.lib", "userenv.lib", "bcrypt.lib", "ntdll.lib", "synchronization.lib"];
|
||||
if is_win7() {
|
||||
libs.push("advapi32.lib");
|
||||
}
|
||||
libs
|
||||
} else {
|
||||
vec!["-lws2_32", "-luserenv", "-lbcrypt", "-lntdll", "-lsynchronization"]
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ pub use run::{cmd, run, run_fail, run_with_args};
|
||||
|
||||
/// Helpers for checking target information.
|
||||
pub use targets::{
|
||||
apple_os, is_aix, is_darwin, is_msvc, is_windows, is_windows_gnu, llvm_components_contain,
|
||||
apple_os, is_aix, is_darwin, is_msvc, is_windows, is_windows_gnu, is_win7, llvm_components_contain,
|
||||
target, uname,
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,12 @@ pub fn is_windows_gnu() -> bool {
|
||||
target().ends_with("windows-gnu")
|
||||
}
|
||||
|
||||
/// Check if target is win7.
|
||||
#[must_use]
|
||||
pub fn is_win7() -> bool {
|
||||
target().contains("win7")
|
||||
}
|
||||
|
||||
/// Check if target uses macOS.
|
||||
#[must_use]
|
||||
pub fn is_darwin() -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user