rustc_target/spec/base/
msvc.rs

1use std::borrow::Cow;
2
3use crate::spec::{BinaryFormat, 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        binary_format: BinaryFormat::Coff,
16        pre_link_args,
17        abi_return_struct_as_int: true,
18        emit_debug_gdb_scripts: false,
19        archive_format: "coff".into(),
20
21        // Currently this is the only supported method of debuginfo on MSVC
22        // where `*.pdb` files show up next to the final artifact.
23        split_debuginfo: SplitDebuginfo::Packed,
24        supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Packed]),
25        debuginfo_kind: DebuginfoKind::Pdb,
26
27        ..Default::default()
28    }
29}