Commit f79ed9d1 authored by dpranke's avatar dpranke Committed by Commit bot

Make sure PDB files are in runtime_deps for GN builds.

Before r407890, we had no good way to make sure that
we were including the .pdb files for executables and
shared libraries in the runtime_deps for a target.
Now that GN has a `runtime_outputs` option, we can
use that and list the PDBs. This should fix issues
for debugging and also packaging the NaCl files as
part of an official build.

R=brettw@chromium.org, sebmarchand@chromium.org
BUG=624478, 629709

Review-Url: https://codereview.chromium.org/2192643002
Cr-Commit-Position: refs/heads/master@{#408282}
parent 27752d3e
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/clang/clang.gni") import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/win/visual_studio_version.gni") import("//build/config/win/visual_studio_version.gni")
import("//build/toolchain/goma.gni") import("//build/toolchain/goma.gni")
...@@ -179,9 +180,10 @@ template("msvc_toolchain") { ...@@ -179,9 +180,10 @@ template("msvc_toolchain") {
tool("solink") { tool("solink") {
dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e.g. foo.dll dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e.g. foo.dll
libname = "${dllname}.lib" # e.g. foo.dll.lib libname = "${dllname}.lib" # e.g. foo.dll.lib
pdbname = "${dllname}.pdb"
rspfile = "${dllname}.rsp" rspfile = "${dllname}.rsp"
command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile" command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:$pdbname @$rspfile"
default_output_extension = ".dll" default_output_extension = ".dll"
default_output_dir = "{{root_out_dir}}" default_output_dir = "{{root_out_dir}}"
...@@ -193,6 +195,10 @@ template("msvc_toolchain") { ...@@ -193,6 +195,10 @@ template("msvc_toolchain") {
link_output = libname link_output = libname
depend_output = libname depend_output = libname
runtime_outputs = [ dllname ] runtime_outputs = [ dllname ]
if (symbol_level != 0) {
outputs += [ pdbname ]
runtime_outputs += [ pdbname ]
}
# Since the above commands only updates the .lib file when it changes, ask # Since the above commands only updates the .lib file when it changes, ask
# Ninja to check if the timestamp actually changed to know if downstream # Ninja to check if the timestamp actually changed to know if downstream
...@@ -206,9 +212,10 @@ template("msvc_toolchain") { ...@@ -206,9 +212,10 @@ template("msvc_toolchain") {
tool("solink_module") { tool("solink_module") {
dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e.g. foo.dll dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" # e.g. foo.dll
pdbname = "${dllname}.pdb"
rspfile = "${dllname}.rsp" rspfile = "${dllname}.rsp"
command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /DLL /OUT:$dllname /PDB:${dllname}.pdb @$rspfile" command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /DLL /OUT:$dllname /PDB:$pdbname @$rspfile"
default_output_extension = ".dll" default_output_extension = ".dll"
default_output_dir = "{{root_out_dir}}" default_output_dir = "{{root_out_dir}}"
...@@ -216,6 +223,10 @@ template("msvc_toolchain") { ...@@ -216,6 +223,10 @@ template("msvc_toolchain") {
outputs = [ outputs = [
dllname, dllname,
] ]
if (symbol_level != 0) {
outputs += [ pdbname ]
}
runtime_outputs = outputs
# The use of inputs_newline is to work around a fixed per-line buffer # The use of inputs_newline is to work around a fixed per-line buffer
# size in the linker. # size in the linker.
...@@ -223,16 +234,22 @@ template("msvc_toolchain") { ...@@ -223,16 +234,22 @@ template("msvc_toolchain") {
} }
tool("link") { tool("link") {
rspfile = "{{output}}.rsp" exename = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
pdbname = "$exename.pdb"
rspfile = "$exename.rsp"
command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /OUT:{{output}} /PDB:{{output}}.pdb @$rspfile" command = "$python_path gyp-win-tool link-wrapper $env False $link /nologo /OUT:$exename /PDB:$pdbname @$rspfile"
default_output_extension = ".exe" default_output_extension = ".exe"
default_output_dir = "{{root_out_dir}}" default_output_dir = "{{root_out_dir}}"
description = "LINK {{output}}" description = "LINK {{output}}"
outputs = [ outputs = [
"{{output_dir}}/{{target_output_name}}{{output_extension}}", exename,
] ]
if (symbol_level != 0) {
outputs += [ pdbname ]
}
runtime_outputs = outputs
# The use of inputs_newline is to work around a fixed per-line buffer # The use of inputs_newline is to work around a fixed per-line buffer
# size in the linker. # size in the linker.
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/compiler/compiler.gni")
# This file builds nacl64.exe, which is a 64-bit x86 Windows executable # This file builds nacl64.exe, which is a 64-bit x86 Windows executable
# used only in the 32-bit x86 Windows build. The :broker code runs both # used only in the 32-bit x86 Windows build. The :broker code runs both
...@@ -67,6 +68,9 @@ if (current_cpu == "x86") { ...@@ -67,6 +68,9 @@ if (current_cpu == "x86") {
sources = [ sources = [
"$nacl64_out_dir/nacl64.exe", "$nacl64_out_dir/nacl64.exe",
] ]
if (symbol_level != 0) {
sources += [ "$nacl64_out_dir/nacl64.exe.pdb" ]
}
outputs = [ outputs = [
"$root_out_dir/{{source_file_part}}", "$root_out_dir/{{source_file_part}}",
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment