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

Unified Diff: pylib/gyp/generator/ninja.py

Issue 97873002: ninja/win: Support VCLinkerTool.GenerateManifest (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
===================================================================
--- pylib/gyp/generator/ninja.py (revision 1801)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -1581,18 +1581,24 @@
def _AddWinLinkRules(master_ninja, embed_manifest, link_incremental):
"""Adds link rules for Windows platform to |master_ninja|."""
def FullLinkCommand(ldcmd, out, binary_type):
- cmd = ('cmd /c %(ldcmd)s'
- ' && %(python)s gyp-win-tool manifest-wrapper $arch'
- ' cmd /c if exist %(out)s.manifest del %(out)s.manifest'
- ' && %(python)s gyp-win-tool manifest-wrapper $arch'
- ' $mt -nologo -manifest $manifests')
+ """Returns a one-liner written for cmd.exe to handle multiphase linker
+ operations including manifest file generation. The command will be
+ structured as follows:
+ cmd /c (linkcmd1 a b) && (linkcmd2 x y) && ... &&
+ if not "$manifests"=="" ((manifestcmd1 a b) && (manifestcmd2 x y) && ... )
+ Note that $manifests becomes empty when no manifest file is generated."""
+ link_commands = ['%(ldcmd)s',
+ 'if exist %(out)s.manifest del %(out)s.manifest']
+ mt_cmd = ('%(python)s gyp-win-tool manifest-wrapper'
+ ' $arch $mt -nologo -manifest $manifests')
if embed_manifest and not link_incremental:
# Embed manifest into a binary. If incremental linking is enabled,
# embedding is postponed to the re-linking stage (see below).
- cmd += ' -outputresource:%(out)s;%(resname)s'
+ mt_cmd += ' -outputresource:%(out)s;%(resname)s'
else:
# Save manifest as an external file.
- cmd += ' -out:%(out)s.manifest'
+ mt_cmd += ' -out:%(out)s.manifest'
+ manifest_commands = [mt_cmd]
if link_incremental:
# There is no point in generating separate rule for the case when
# incremental linking is enabled, but manifest embedding is disabled.
@@ -1600,11 +1606,14 @@
# See also implementation of _GetWinLinkRuleNameSuffix().
assert embed_manifest
# Make .rc file out of manifest, compile it to .res file and re-link.
- cmd += (' && %(python)s gyp-win-tool manifest-to-rc $arch'
- ' %(out)s.manifest %(out)s.manifest.rc %(resname)s'
- ' && %(python)s gyp-win-tool rc-wrapper $arch $rc'
- ' %(out)s.manifest.rc'
- ' && %(ldcmd)s %(out)s.manifest.res')
+ manifest_commands += [
+ ('%(python)s gyp-win-tool manifest-to-rc $arch %(out)s.manifest'
+ ' %(out)s.manifest.rc %(resname)s'),
+ '%(python)s gyp-win-tool rc-wrapper $arch $rc %(out)s.manifest.rc',
+ '%(ldcmd)s %(out)s.manifest.res']
+ cmd = 'cmd /c %s && if not "$manifests"=="" (%s)' % (
+ ' && '.join(['(%s)' % c for c in link_commands]),
+ ' && '.join(['(%s)' % c for c in manifest_commands]))
resource_name = {
'exe': '1',
'dll': '2',
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698