rustc_target/spec/base/
msvc.rs

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