Skip to content

build: add Source Link to embed GitHub source mappings in PDBs#40055

Open
benhillis wants to merge 1 commit intomasterfrom
user/benhill/source_link
Open

build: add Source Link to embed GitHub source mappings in PDBs#40055
benhillis wants to merge 1 commit intomasterfrom
user/benhill/source_link

Conversation

@benhillis
Copy link
Copy Markdown
Member

When a debugger (Visual Studio, WinDbg, VS Code) loads a PDB and needs to show source, it reads this mapping, substitutes the local build path with the URL, and fetches the exact source file from the server.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Source Link support to the Windows CMake build so generated PDBs can map local source paths to GitHub URLs, enabling debuggers to fetch exact source files for a given commit.

Changes:

  • Generate a sourcelink.json file during CMake configure with document mappings to raw.githubusercontent.com for the current COMMIT_HASH.
  • Pass /SOURCELINK:<json> to the MSVC linker for DLL and EXE targets.

@benhillis benhillis force-pushed the user/benhill/source_link branch from 26d09cc to 51a0268 Compare March 31, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants