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

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

Issue 12052029: ninja windows: Make pch work on VS2012, and simplify implementation (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 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 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 1564)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -418,7 +418,8 @@
gyp.msvs_emulation.VerifyMissingSources(
sources, self.abs_build_dir, generator_flags, self.GypPathToNinja)
pch = gyp.msvs_emulation.PrecompiledHeader(
- self.msvs_settings, config_name, self.GypPathToNinja)
+ self.msvs_settings, config_name, self.GypPathToNinja,
+ self.GypPathToUniqueOutput, self.obj_ext)
else:
pch = gyp.xcode_emulation.MacPrefixHeader(
self.xcode_settings, self.GypPathToNinja,
@@ -822,9 +823,14 @@
if not case_sensitive_filesystem:
output = output.lower()
implicit = precompiled_header.GetObjDependencies([input], [output])
+ variables = []
+ if self.flavor == 'win':
+ variables, output, implicit = precompiled_header.GetFlagsModifications(
+ input, output, implicit, command, cflags_c, cflags_cc,
+ self.ExpandSpecial)
self.ninja.build(output, command, input,
implicit=[gch for _, _, gch in implicit],
- order_only=predepends)
+ order_only=predepends, variables=variables)
outputs.append(output)
self.WritePchTargets(pch_commands)
@@ -846,8 +852,6 @@
}[lang]
map = { 'c': 'cc', 'cc': 'cxx', 'm': 'objc', 'mm': 'objcxx', }
- if self.flavor == 'win':
- map.update({'c': 'cc_pch', 'cc': 'cxx_pch'})
cmd = map.get(lang)
self.ninja.build(gch, cmd, input, variables=[(var_name, lang_flag)])
@@ -1455,49 +1459,29 @@
'$cflags_pch_cc -c $in -o $out'),
depfile='$out.d')
else:
- # Template for compile commands mostly shared between compiling files
- # and generating PCH. In the case of PCH, the "output" is specified by /Fp
- # rather than /Fo (for object files), but we still need to specify an /Fo
- # when compiling PCH.
- cc_template = ('ninja -t msvc -o $out -e $arch '
+ cc_command = ('ninja -t msvc -o $out -e $arch '
+ '-- '
+ '$cc /nologo /showIncludes /FC '
+ '@$out.rsp /c $in /Fo$out /Fd$pdbname ')
+ cxx_command = ('ninja -t msvc -o $out -e $arch '
'-- '
- '$cc /nologo /showIncludes /FC '
- '@$out.rsp '
- '$cflags_pch_c /c $in %(outspec)s /Fd$pdbname ')
- cxx_template = ('ninja -t msvc -o $out -e $arch '
- '-- '
- '$cxx /nologo /showIncludes /FC '
- '@$out.rsp '
- '$cflags_pch_cc /c $in %(outspec)s $pchobj /Fd$pdbname ')
+ '$cxx /nologo /showIncludes /FC '
+ '@$out.rsp /c $in /Fo$out /Fd$pdbname ')
master_ninja.rule(
'cc',
description='CC $out',
- command=cc_template % {'outspec': '/Fo$out'},
+ command=cc_command,
depfile='$out.d',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_c')
master_ninja.rule(
- 'cc_pch',
- description='CC PCH $out',
- command=cc_template % {'outspec': '/Fp$out /Fo$out.obj'},
- depfile='$out.d',
- rspfile='$out.rsp',
- rspfile_content='$defines $includes $cflags $cflags_c')
- master_ninja.rule(
'cxx',
description='CXX $out',
- command=cxx_template % {'outspec': '/Fo$out'},
+ command=cxx_command,
depfile='$out.d',
rspfile='$out.rsp',
rspfile_content='$defines $includes $cflags $cflags_cc')
master_ninja.rule(
- 'cxx_pch',
- description='CXX PCH $out',
- command=cxx_template % {'outspec': '/Fp$out /Fo$out.obj'},
- depfile='$out.d',
- rspfile='$out.rsp',
- rspfile_content='$defines $includes $cflags $cflags_cc')
- master_ninja.rule(
'idl',
description='IDL $in',
command=('%s gyp-win-tool midl-wrapper $arch $outdir '
« 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