Skip to content

Commit

Permalink
Remove PDB from outputs of msvc link tools
Browse files Browse the repository at this point in the history
Output PDBs are only generated when the /DEBUG flag is present. If it
is not, ninja will not find the output PDB and consider the edge
dirty, thus always rebuilding the target even if unnecessary.

b/217794556

Change-Id: Iee079ace009a316dcc37c75e282c7c20e4aad390
NOKEYCHECK=True
GitOrigin-RevId: 51dde43c9568b05f4c30ed2606dd3c9542983f64
  • Loading branch information
andrewsavage1 committed Feb 24, 2023
1 parent 047e155 commit 0bc571c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build/toolchain/win/msvc_toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ template("msvc_toolchain") {
rspfile_content = "{{inputs_newline}}"
}

# TODO(b/217794556): All following linker tools should list the PDB file in
# their outputs. It has been removed as it is not always generated, and
# ninja will treat the missing file as a dirty edge.
tool("solink") {
# E.g. "foo.dll":
dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
Expand All @@ -157,13 +160,11 @@ template("msvc_toolchain") {
outputs = [
dllname,
libname,
pdbname,
]
link_output = libname
depend_output = libname
runtime_outputs = [
dllname,
pdbname,
]

# Since the above commands only updates the .lib file when it changes, ask
Expand All @@ -190,7 +191,6 @@ template("msvc_toolchain") {
description = "LINK_MODULE(DLL) {{output}}"
outputs = [
dllname,
pdbname,
]
runtime_outputs = outputs

Expand All @@ -212,7 +212,6 @@ template("msvc_toolchain") {
description = "LINK {{output}}"
outputs = [
exename,
pdbname,
]
runtime_outputs = outputs

Expand Down

0 comments on commit 0bc571c

Please sign in to comment.