[build] Add sourcelink support for windows pdbs (#2592)

SourceLink embeds the git repo and hash into the pdbs, which allows VS to get the source files exactly matching a pdb directly from github.

Only VS and WinDbg are supported currently, but there are issues in the vscode tools repo to enable it there.
This commit is contained in:
Thad House
2020-08-29 20:27:20 -07:00
committed by GitHub
parent c0de98f9f2
commit 83376bc231
5 changed files with 35 additions and 5 deletions

View File

@@ -10,8 +10,9 @@ nativeUtils {
wpiVersion = "-1"
niLibVersion = "2020.10.1"
opencvVersion = "3.4.7-3"
googleTestVersion = "1.9.0-4-437e100-1"
googleTestVersion = "1.9.0-5-437e100-1"
imguiVersion = "1.76-6"
wpimathVersion = "-1"
}
}
}
@@ -21,6 +22,7 @@ nativeUtils.wpi.addWarningsAsErrors()
nativeUtils.wpi.addReleaseSymbolGeneration()
nativeUtils.setSinglePrintPerPlatform()
nativeUtils.enableSourceLink()
nativeUtils.platformConfigs.each {
if (it.name.contains('windows')) return
@@ -147,6 +149,14 @@ ext.includeStandardZipFormat = { task, value ->
task.from(binary.staticLibraryFile) {
into nativeUtils.getPlatformPath(binary) + '/static'
}
def pdbDir = binary.staticLibraryFile.parentFile
task.from(pdbDir) {
include '*.pdb'
into nativeUtils.getPlatformPath(binary) + '/static'
}
task.from(new File(pdbDir, "SourceLink.json")) {
into nativeUtils.getPlatformPath(binary) + '/static'
}
}
}
}