]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/msvc_base.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / compiler / rustc_target / src / spec / msvc_base.rs
1 use crate::spec::{DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions};
2 use std::borrow::Cow;
3
4 pub fn opts() -> TargetOptions {
5     // Suppress the verbose logo and authorship debugging output, which would needlessly
6     // clog any log files.
7     let pre_link_args = TargetOptions::link_args(LinkerFlavor::Msvc(Lld::No), &["/NOLOGO"]);
8
9     TargetOptions {
10         linker_flavor: LinkerFlavor::Msvc(Lld::No),
11         is_like_windows: true,
12         is_like_msvc: true,
13         pre_link_args,
14         abi_return_struct_as_int: true,
15         emit_debug_gdb_scripts: false,
16
17         // Currently this is the only supported method of debuginfo on MSVC
18         // where `*.pdb` files show up next to the final artifact.
19         split_debuginfo: SplitDebuginfo::Packed,
20         supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Packed]),
21         debuginfo_kind: DebuginfoKind::Pdb,
22
23         ..Default::default()
24     }
25 }