]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/windows_msvc_base.rs
Auto merge of #68414 - michaelwoerister:share-drop-glue, r=alexcrichton
[rust.git] / src / librustc_target / spec / windows_msvc_base.rs
1 use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
2 use std::default::Default;
3
4 pub fn opts() -> TargetOptions {
5     let mut args = LinkArgs::new();
6     args.insert(LinkerFlavor::Msvc, vec!["/NOLOGO".to_string(), "/NXCOMPAT".to_string()]);
7
8     TargetOptions {
9         function_sections: true,
10         dynamic_linking: true,
11         executables: true,
12         dll_prefix: String::new(),
13         dll_suffix: ".dll".to_string(),
14         exe_suffix: ".exe".to_string(),
15         staticlib_prefix: String::new(),
16         staticlib_suffix: ".lib".to_string(),
17         target_family: Some("windows".to_string()),
18         is_like_windows: true,
19         is_like_msvc: true,
20         // set VSLANG to 1033 can prevent link.exe from using
21         // language packs, and avoid generating Non-UTF-8 error
22         // messages if a link error occurred.
23         link_env: vec![("VSLANG".to_string(), "1033".to_string())],
24         pre_link_args: args,
25         crt_static_allows_dylibs: true,
26         crt_static_respected: true,
27         abi_return_struct_as_int: true,
28         emit_debug_gdb_scripts: false,
29         requires_uwtable: true,
30
31         ..Default::default()
32     }
33 }