Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 126443004: win ninja: include .pdb in linker outputs (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: . Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | pylib/gyp/msvs_emulation.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import hashlib 6 import hashlib
7 import json 7 import json
8 import multiprocessing 8 import multiprocessing
9 import os.path 9 import os.path
10 import re 10 import re
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 if command in ('solink', 'solink_module'): 1093 if command in ('solink', 'solink_module'):
1094 extra_bindings.append(('soname', os.path.split(output)[1])) 1094 extra_bindings.append(('soname', os.path.split(output)[1]))
1095 extra_bindings.append(('lib', 1095 extra_bindings.append(('lib',
1096 gyp.common.EncodePOSIXShellArgument(output))) 1096 gyp.common.EncodePOSIXShellArgument(output)))
1097 if self.flavor == 'win': 1097 if self.flavor == 'win':
1098 extra_bindings.append(('dll', output)) 1098 extra_bindings.append(('dll', output))
1099 if '/NOENTRY' not in ldflags: 1099 if '/NOENTRY' not in ldflags:
1100 self.target.import_lib = output + '.lib' 1100 self.target.import_lib = output + '.lib'
1101 extra_bindings.append(('implibflag', 1101 extra_bindings.append(('implibflag',
1102 '/IMPLIB:%s' % self.target.import_lib)) 1102 '/IMPLIB:%s' % self.target.import_lib))
1103 pdbname = self.msvs_settings.GetPDBName(
1104 config_name, self.ExpandSpecial, output + '.pdb')
1103 output = [output, self.target.import_lib] 1105 output = [output, self.target.import_lib]
1106 if pdbname:
1107 output.append(pdbname)
1104 elif not self.is_mac_bundle: 1108 elif not self.is_mac_bundle:
1105 output = [output, output + '.TOC'] 1109 output = [output, output + '.TOC']
1106 else: 1110 else:
1107 command = command + '_notoc' 1111 command = command + '_notoc'
1112 elif self.flavor == 'win':
1113 extra_bindings.append(('exe', output))
1114 pdbname = self.msvs_settings.GetPDBName(
Nico 2014/01/08 21:44:13 # Must match /PDB: flag in the 'link' rule.
scottmg 2014/01/08 21:54:57 It's confusing, but it actually doesn't have to. T
1115 config_name, self.ExpandSpecial, output + '.pdb')
Nico 2014/01/08 21:44:13 default=output + '.pdb'
scottmg 2014/01/08 21:54:57 Done. (and above)
1116 if pdbname:
1117 output = [output, pdbname]
1118
1108 1119
1109 if len(solibs): 1120 if len(solibs):
1110 extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs))) 1121 extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs)))
1111 1122
1112 ninja_file.build(output, command + command_suffix, link_deps, 1123 ninja_file.build(output, command + command_suffix, link_deps,
1113 implicit=list(implicit_deps), 1124 implicit=list(implicit_deps),
1114 variables=extra_bindings) 1125 variables=extra_bindings)
1115 return linked_binary 1126 return linked_binary
1116 1127
1117 def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): 1128 def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 rspfile_content='$libs $in_newline $ldflags', 1613 rspfile_content='$libs $in_newline $ldflags',
1603 restat=True, 1614 restat=True,
1604 pool='link_pool') 1615 pool='link_pool')
1605 master_ninja.rule('solink_module' + rule_name_suffix, 1616 master_ninja.rule('solink_module' + rule_name_suffix,
1606 description=dlldesc, command=dllcmd, 1617 description=dlldesc, command=dllcmd,
1607 rspfile='$dll.rsp', 1618 rspfile='$dll.rsp',
1608 rspfile_content='$libs $in_newline $ldflags', 1619 rspfile_content='$libs $in_newline $ldflags',
1609 restat=True, 1620 restat=True,
1610 pool='link_pool') 1621 pool='link_pool')
1611 # Note that ldflags goes at the end so that it has the option of 1622 # Note that ldflags goes at the end so that it has the option of
1612 # overriding default settings earlier in the command line. 1623 # overriding default settings earlier in the command line.
Nico 2014/01/08 21:44:13 # The /PDB: argument must match the pdbname writte
1613 exe_cmd = ('%s gyp-win-tool link-wrapper $arch ' 1624 exe_cmd = ('%s gyp-win-tool link-wrapper $arch '
1614 '$ld /nologo /OUT:$out /PDB:$out.pdb @$out.rsp' % 1625 '$ld /nologo /OUT:$exe /PDB:$exe.pdb @$exe.rsp' %
1615 sys.executable) 1626 sys.executable)
1616 exe_cmd = FullLinkCommand(exe_cmd, '$out', 'exe') 1627 exe_cmd = FullLinkCommand(exe_cmd, '$exe', 'exe')
1617 master_ninja.rule('link' + rule_name_suffix, 1628 master_ninja.rule('link' + rule_name_suffix,
1618 description='LINK%s $out' % rule_name_suffix.upper(), 1629 description='LINK%s $exe' % rule_name_suffix.upper(),
1619 command=exe_cmd, 1630 command=exe_cmd,
1620 rspfile='$out.rsp', 1631 rspfile='$exe.rsp',
1621 rspfile_content='$in_newline $libs $ldflags', 1632 rspfile_content='$in_newline $libs $ldflags',
1622 pool='link_pool') 1633 pool='link_pool')
1623 1634
1624 1635
1625 def GenerateOutputForConfig(target_list, target_dicts, data, params, 1636 def GenerateOutputForConfig(target_list, target_dicts, data, params,
1626 config_name): 1637 config_name):
1627 options = params['options'] 1638 options = params['options']
1628 flavor = gyp.common.GetFlavor(params) 1639 flavor = gyp.common.GetFlavor(params)
1629 generator_flags = params.get('generator_flags', {}) 1640 generator_flags = params.get('generator_flags', {})
1630 1641
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 if gyp.common.GetFlavor(params) == 'win': 2120 if gyp.common.GetFlavor(params) == 'win':
2110 target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) 2121 target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts)
2111 target_list, target_dicts = MSVSUtil.InsertLargePdbShims( 2122 target_list, target_dicts = MSVSUtil.InsertLargePdbShims(
2112 target_list, target_dicts, generator_default_variables) 2123 target_list, target_dicts, generator_default_variables)
2113 2124
2114 if user_config: 2125 if user_config:
2115 GenerateOutputForConfig(target_list, target_dicts, data, params, 2126 GenerateOutputForConfig(target_list, target_dicts, data, params,
2116 user_config) 2127 user_config)
2117 else: 2128 else:
2118 config_names = target_dicts[target_list[0]]['configurations'].keys() 2129 config_names = target_dicts[target_list[0]]['configurations'].keys()
2119 if params['parallel']: 2130 if False: #params['parallel']:
Nico 2014/01/08 21:44:13 I assume you don't mean to land this part :-)
scottmg 2014/01/08 21:54:57 Ahem. I need to look into why the stack traces are
2120 try: 2131 try:
2121 pool = multiprocessing.Pool(len(config_names)) 2132 pool = multiprocessing.Pool(len(config_names))
2122 arglists = [] 2133 arglists = []
2123 for config_name in config_names: 2134 for config_name in config_names:
2124 arglists.append( 2135 arglists.append(
2125 (target_list, target_dicts, data, params, config_name)) 2136 (target_list, target_dicts, data, params, config_name))
2126 pool.map(CallGenerateOutputForConfig, arglists) 2137 pool.map(CallGenerateOutputForConfig, arglists)
2127 except KeyboardInterrupt, e: 2138 except KeyboardInterrupt, e:
2128 pool.terminate() 2139 pool.terminate()
2129 raise e 2140 raise e
2130 else: 2141 else:
2131 for config_name in config_names: 2142 for config_name in config_names:
2132 GenerateOutputForConfig(target_list, target_dicts, data, params, 2143 GenerateOutputForConfig(target_list, target_dicts, data, params,
2133 config_name) 2144 config_name)
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | pylib/gyp/msvs_emulation.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698