Index: pylib/gyp/generator/ninja.py |
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py |
index 4b48b4010da26ba41b5a04d1f1cc85f091c3718d..aea58cfcceb462ec4cf6e7a8f391aa5c5b2a363d 100644 |
--- a/pylib/gyp/generator/ninja.py |
+++ b/pylib/gyp/generator/ninja.py |
@@ -583,10 +583,7 @@ class NinjaWriter: |
def WriteActions(self, actions, extra_sources, prebuild, |
extra_mac_bundle_resources): |
# Actions cd into the base directory. |
- env = self.GetSortedXcodeEnv() |
- if self.flavor == 'win': |
- env = self.msvs_settings.GetVSMacroEnv( |
- '$!PRODUCT_DIR', config=self.config_name) |
+ env = self.GetSortedToolchainEnv() |
all_outputs = [] |
for action in actions: |
# First write out a rule for the action. |
@@ -619,7 +616,7 @@ class NinjaWriter: |
def WriteRules(self, rules, extra_sources, prebuild, |
mac_bundle_resources, extra_mac_bundle_resources): |
- env = self.GetSortedXcodeEnv() |
+ env = self.GetSortedToolchainEnv() |
all_outputs = [] |
for rule in rules: |
# First write out a rule for the rule action. |
@@ -721,7 +718,7 @@ class NinjaWriter: |
def WriteCopies(self, copies, prebuild, mac_bundle_depends): |
outputs = [] |
- env = self.GetSortedXcodeEnv() |
+ env = self.GetSortedToolchainEnv() |
for copy in copies: |
for path in copy['files']: |
# Normalize the path so trailing slashes don't confuse us. |
@@ -855,8 +852,7 @@ class NinjaWriter: |
include_dirs = config.get('include_dirs', []) |
env = self.GetSortedXcodeEnv() |
scottmg
2014/03/12 18:19:17
collapse this one too?
etienneb
2014/03/12 20:07:53
Done.
|
if self.flavor == 'win': |
- env = self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR', |
- config=config_name) |
+ env = self.GetSortedToolchainEnv() |
include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs, |
config_name) |
self.WriteVariableList(ninja_file, 'includes', |
@@ -1199,6 +1195,19 @@ class NinjaWriter: |
self.target.bundle = output |
return output |
+ def GetSortedToolchainEnv(self, additional_settings=None): |
+ """Returns the variables toolchain would set for build steps.""" |
+ if self.flavor == 'win': |
+ return self.GetSortedMsvsEnv(additional_settings=additional_settings) |
+ if self.flavor == 'mac': |
+ return self.GetSortedXcodeEnv(additional_settings=additional_settings) |
+ assert false, "Invalid architecture." |
scottmg
2014/03/12 18:19:17
I feel like this will probably be called for Linux
etienneb
2014/03/12 20:07:53
I changed it to have the same semantic as before.
|
+ |
+ def GetSortedMsvsEnv(self, additional_settings=None): |
scottmg
2014/03/12 18:19:17
The environment returned here isn't sorted, so I d
etienneb
2014/03/12 20:07:53
Done.
|
+ """Returns the variables Visual Studio would set for build steps.""" |
+ return self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR', |
+ config=self.config_name) |
+ |
def GetSortedXcodeEnv(self, additional_settings=None): |
"""Returns the variables Xcode would set for build steps.""" |
assert self.abs_build_dir |