Chromium Code Reviews| Index: pylib/gyp/generator/ninja.py |
| diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py |
| index 3662e491b440e4b3d288ec1acd161afb2c8a18ce..0dedf4c4efd4d36d29a3a70a91f3244323a8464b 100644 |
| --- a/pylib/gyp/generator/ninja.py |
| +++ b/pylib/gyp/generator/ninja.py |
| @@ -495,7 +495,10 @@ class NinjaWriter: |
| name) |
| is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) |
| if self.flavor == 'win' else False) |
| - rule_name = self.WriteNewNinjaRule(name, action['action'], description, |
| + args = action['action'] |
| + args = [self.msvs_settings.ConvertVSMacros(arg, self.base_to_build) |
| + for arg in args] if self.flavor == 'win' else args |
| + rule_name = self.WriteNewNinjaRule(name, args, description, |
| is_cygwin, env=env) |
| inputs = [self.GypPathToNinja(i, env) for i in action['inputs']] |
| @@ -527,6 +530,8 @@ class NinjaWriter: |
| ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) |
| is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) |
| if self.flavor == 'win' else False) |
| + args = [self.msvs_settings.ConvertVSMacros(arg, self.base_to_build) |
| + for arg in args] if self.flavor == 'win' else args |
| rule_name = self.WriteNewNinjaRule(name, args, description, is_cygwin) |
| # TODO: if the command references the outputs directly, we should |
| @@ -1074,6 +1079,8 @@ class NinjaWriter: |
| args = args[:] |
| + description = self.msvs_settings.ConvertVSMacros(description) |
|
Nico
2012/04/30 23:33:27
This will crash on non-windows systems due to msvs
scottmg
2012/04/30 23:42:27
Oops, thanks. Done.
|
| + |
| # gyp dictates that commands are run from the base directory. |
| # cd into the directory before running, and adjust paths in |
| # the arguments to point to the proper locations. |
| @@ -1087,8 +1094,6 @@ class NinjaWriter: |
| args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] |
| env = self.ComputeExportEnvString(env) if self.flavor != 'win' else '' |
| if self.flavor == 'win': |
| - args = [self.msvs_settings.ConvertVSMacros(a, self.base_to_build) |
| - for a in args] |
|
Nico
2012/04/30 23:33:27
Why did this have to move up (to two places)?
scottmg
2012/04/30 23:42:27
It has to happen outside for WriteRules (the note
|
| if is_cygwin: |
| command = self.msvs_settings.BuildCygwinBashCommandLine( |
| args, self.build_to_base) |