OLD | NEW |
---|---|
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """ | 5 """ |
6 This module helps emulate Visual Studio 2008 behavior on top of other | 6 This module helps emulate Visual Studio 2008 behavior on top of other |
7 build systems, primarily ninja. | 7 build systems, primarily ninja. |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 for configname, config in configs.iteritems(): | 147 for configname, config in configs.iteritems(): |
148 getattr(self, field)[configname] = config.get(field, default()) | 148 getattr(self, field)[configname] = config.get(field, default()) |
149 | 149 |
150 self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) | 150 self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) |
151 | 151 |
152 def GetVSMacroEnv(self, base_to_build=None): | 152 def GetVSMacroEnv(self, base_to_build=None): |
153 """Get a dict of variables mapping internal VS macro names to their gyp | 153 """Get a dict of variables mapping internal VS macro names to their gyp |
154 equivalents.""" | 154 equivalents.""" |
155 replacements = { | 155 replacements = { |
156 '$(VSInstallDir)': self.vs_version.Path(), | 156 '$(VSInstallDir)': self.vs_version.Path(), |
157 '$(VCInstallDir)': os.path.join(self.vs_version.Path(), 'VC'), | 157 '$(VCInstallDir)': os.path.join(self.vs_version.Path(), 'VC') + "\\", |
Nico
2012/05/03 22:28:09
nit: ' not ", for local consistency
scottmg
2012/05/03 22:41:36
Done.
5 non-space characters, and I get 40% of th
| |
158 '$(OutDir)\\': base_to_build + '\\' if base_to_build else '', | 158 '$(OutDir)\\': base_to_build + '\\' if base_to_build else '', |
159 '$(IntDir)': '$!INTERMEDIATE_DIR', | 159 '$(IntDir)': '$!INTERMEDIATE_DIR', |
160 '$(InputPath)': '${source}', | 160 '$(InputPath)': '${source}', |
161 '$(InputName)': '${root}', | 161 '$(InputName)': '${root}', |
162 '$(ProjectName)': self.spec['target_name'], | 162 '$(ProjectName)': self.spec['target_name'], |
163 '$(PlatformName)': 'Win32', # TODO(scottmg): Support for x64 toolchain. | 163 '$(PlatformName)': 'Win32', # TODO(scottmg): Support for x64 toolchain. |
164 } | 164 } |
165 # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be | 165 # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be |
166 # set. This happens when the SDK is sync'd via src-internal, rather than | 166 # set. This happens when the SDK is sync'd via src-internal, rather than |
167 # by typical end-user installation of the SDK. If it's not set, we don't | 167 # by typical end-user installation of the SDK. If it's not set, we don't |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 return vs.SetupScript() | 463 return vs.SetupScript() |
464 | 464 |
465 def ExpandMacros(string, expansions): | 465 def ExpandMacros(string, expansions): |
466 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv | 466 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv |
467 for the canonical way to retrieve a suitable dict.""" | 467 for the canonical way to retrieve a suitable dict.""" |
468 if '$' in string: | 468 if '$' in string: |
469 for old, new in expansions.iteritems(): | 469 for old, new in expansions.iteritems(): |
470 assert '$(' not in new, new | 470 assert '$(' not in new, new |
471 string = string.replace(old, new) | 471 string = string.replace(old, new) |
472 return string | 472 return string |
OLD | NEW |