Skip to content

Commit 211535b

Browse files
author
Colin Robertson
committed
Add /SOURCELINK linker option
1 parent 5f56d98 commit 211535b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/build/reference/sourcelink.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "/SOURCELINK (Include Sourcelink file in PDB) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "08/20/2018"
5+
ms.technology: ["cpp-tools"]
6+
ms.topic: "reference"
7+
f1_keywords: ["/sourcelink"]
8+
dev_langs: ["C++"]
9+
helpviewer_keywords: ["/SOURCELINK linker option", "/SOURCELINK"]
10+
author: "corob-msft"
11+
ms.author: "corob"
12+
ms.workload: ["cplusplus"]
13+
---
14+
# /SOURCELINK (Include Sourcelink file in PDB)
15+
16+
Specifies a SourceLink configuration file to include in the PDB file generated by the linker.
17+
18+
## Syntax
19+
20+
> **/SOURCELINK**[__:__*filename*]
21+
22+
## Arguments
23+
24+
*filename*
25+
Specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs where the source file can be retrieved for display by the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md#source-link-json-schema).
26+
27+
## Remarks
28+
29+
SourceLink is a language- and source-control agnostic system for providing first-class source debugging experiences for binaries. SourceLink is supported for native C++ binaries starting in Visual Studio 2017 version 15.7. For an overview of SourceLink, see [Source Link](https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md). For information on how to use SourceLink in your projects and how to generate the SourceLink file, see [Using SourceLink](https://github.com/dotnet/sourcelink#using-sourcelink).
30+
31+
### To set the /SOURCELINK linker option in Visual Studio
32+
33+
1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../../ide/working-with-project-properties.md).
34+
35+
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
36+
37+
1. In the **Additional options** box, add **/SOURCELINK:**_filename_ and then choose **OK** or **Apply** to save your changes.
38+
39+
### To set this linker option programmatically
40+
41+
- This option does not have a programmatic equivalent.
42+
43+
## See also
44+
45+
[Setting Linker Options](../../build/reference/setting-linker-options.md)
46+
[Linker Options](../../build/reference/linker-options.md)

0 commit comments

Comments
 (0)