Index: pylib/gyp/generator/ninja.py |
=================================================================== |
--- pylib/gyp/generator/ninja.py (revision 1421) |
+++ pylib/gyp/generator/ninja.py (working copy) |
@@ -345,8 +345,8 @@ |
if self.flavor == 'win': |
self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, |
generator_flags) |
- # TODO(scottmg): x64 support. |
- self.ninja.variable('arch', self.win_env['x86']) |
+ target_platform = self.msvs_settings.GetTargetPlatform(config_name) |
+ self.ninja.variable('arch', self.win_env[target_platform]) |
# Compute predepends for all rules. |
# actions_depends is the dependencies this target depends on before running |
@@ -750,11 +750,12 @@ |
if ext in ('cc', 'cpp', 'cxx'): |
command = 'cxx' |
elif ext == 'c' or (ext in ('s', 'S') and self.flavor != 'win'): |
- # TODO(scottmg): .s files won't be handled by the Windows compiler. |
- # We could add support for .asm, though that's only supported on |
- # x86. Currently not used in Chromium in favor of other third-party |
- # assemblers. |
command = 'cc' |
+ elif (self.flavor == 'win' and ext == 'asm' and |
+ self.msvs_settings.GetTargetPlatform(config_name) == 'Win32'): |
+ # Asm files only get auto assembled for x86 (not x64). |
scottmg
2012/06/27 23:08:11
Is that a TODO? Or does VS actually not run ml64 a
bradn
2012/06/28 01:37:51
Frighteningly it doesn't run it.
|
+ command = 'asm' |
+ obj_ext = '_asm.obj' |
scottmg
2012/06/27 23:08:11
is there a reason to add _asm to the name?
bradn
2012/06/28 01:37:51
There's one instance in the code base in which the
|
elif self.flavor == 'mac' and ext == 'm': |
command = 'objc' |
elif self.flavor == 'mac' and ext == 'mm': |
@@ -1266,6 +1267,7 @@ |
master_ninja.variable('idl', 'midl.exe') |
master_ninja.variable('ar', 'lib.exe') |
master_ninja.variable('rc', 'rc.exe') |
+ master_ninja.variable('asm', 'ml.exe') |
else: |
master_ninja.variable('ld', flock + ' linker.lock $cxx') |
master_ninja.variable('ar', os.environ.get('AR', 'ar')) |
@@ -1353,6 +1355,12 @@ |
command=('%s gyp-win-tool rc-wrapper ' |
'$arch $rc $defines $includes $rcflags /fo$out $in' % |
sys.executable)) |
+ master_ninja.rule( |
+ 'asm', |
+ description='ASM $in', |
+ command=('%s gyp-win-tool asm-wrapper ' |
+ '$arch $asm $defines $includes /c /Fo $out $in' % |
+ sys.executable)) |
if flavor != 'mac' and flavor != 'win': |
master_ninja.rule( |