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

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

Issue 9424042: Support import libraries for Windows ninja (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/lib/TestGyp.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 1223)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -663,7 +663,7 @@
def WriteLink(self, spec, config_name, config, link_deps):
- """Write out a link step. Returns the path to the output."""
+ """Write out a link step. Fills out target.binary. """
command = {
'executable': 'link',
@@ -717,13 +717,20 @@
libraries = self.xcode_settings.AdjustLibraries(libraries)
self.WriteVariableList('libs', libraries)
+ self.target.binary = output
+
if command in ('solink', 'solink_module'):
extra_bindings.append(('soname', os.path.split(output)[1]))
+ if self.flavor == 'win':
+ import_lib = output + '.lib'
+ extra_bindings.append(('dll', output))
+ extra_bindings.append(('implib', import_lib))
+ self.target.binary = import_lib
+ output = [output, import_lib]
Nico 2012/02/22 00:46:23 Is this last line still needed? Could you do ou
scottmg 2012/02/22 00:53:42 Yes, still required because there has to be a buil
self.ninja.build(output, command, link_deps,
implicit=list(implicit_deps),
variables=extra_bindings)
- return output
def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
if spec['type'] == 'none':
@@ -737,7 +744,7 @@
variables=[('postbuilds', self.GetPostbuildCommand(
spec, self.target.binary, self.target.binary))])
else:
- self.target.binary = self.WriteLink(spec, config_name, config, link_deps)
+ self.WriteLink(spec, config_name, config, link_deps)
return self.target.binary
def WriteMacBundle(self, spec, mac_bundle_depends):
@@ -903,6 +910,8 @@
type_in_output_root = ['executable', 'loadable_module']
if self.flavor == 'mac' and self.toolset == 'target':
type_in_output_root += ['shared_library', 'static_library']
+ elif self.flavor == 'win' and self.toolset == 'target':
+ type_in_output_root += ['shared_library']
if type in type_in_output_root:
return filename
@@ -1116,16 +1125,16 @@
elif flavor == 'win':
master_ninja.rule(
'alink',
- description='AR $out',
+ description='LIB $out',
command='lib /nologo /OUT:$out $in')
master_ninja.rule(
'solink',
- description='SOLINK $out',
- command=('$ld /nologo /DLL $ldflags /OUT:$out $in $libs'))
+ description='LINK(DLL) $dll',
+ command=('$ld /nologo /IMPLIB:$implib /DLL $ldflags /OUT:$dll $in $libs'))
master_ninja.rule(
'solink_module',
- description='SOLINK(module) $out',
- command=('$ld /nologo /DLL $ldflags /OUT:$out $in $libs'))
+ description='LINK(DLL) $dll',
+ command=('$ld /nologo /IMPLIB:$implib /DLL $ldflags /OUT:$dll $in $libs'))
master_ninja.rule(
'link',
description='LINK $out',
« no previous file with comments | « no previous file | test/lib/TestGyp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698