| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 default=None, prefix='', append=None, map=None): | 212 default=None, prefix='', append=None, map=None): |
| 213 """_GetAndMunge for msvs_configuration_attributes.""" | 213 """_GetAndMunge for msvs_configuration_attributes.""" |
| 214 return self._GetAndMunge( | 214 return self._GetAndMunge( |
| 215 self.msvs_configuration_attributes[config], | 215 self.msvs_configuration_attributes[config], |
| 216 path, default, prefix, append, map) | 216 path, default, prefix, append, map) |
| 217 | 217 |
| 218 def AdjustIncludeDirs(self, include_dirs, config): | 218 def AdjustIncludeDirs(self, include_dirs, config): |
| 219 """Updates include_dirs to expand VS specific paths, and adds the system | 219 """Updates include_dirs to expand VS specific paths, and adds the system |
| 220 include dirs used for platform SDK and similar.""" | 220 include dirs used for platform SDK and similar.""" |
| 221 includes = include_dirs + self.msvs_system_include_dirs[config] | 221 includes = include_dirs + self.msvs_system_include_dirs[config] |
| 222 includes.extend(self._Setting( |
| 223 ('VCCLCompilerTool', 'AdditionalIncludeDirectories'), config, default=[])) |
| 222 return [self.ConvertVSMacros(p) for p in includes] | 224 return [self.ConvertVSMacros(p) for p in includes] |
| 223 | 225 |
| 224 def GetComputedDefines(self, config): | 226 def GetComputedDefines(self, config): |
| 225 """Returns the set of defines that are injected to the defines list based | 227 """Returns the set of defines that are injected to the defines list based |
| 226 on other VS settings.""" | 228 on other VS settings.""" |
| 227 defines = [] | 229 defines = [] |
| 228 if self._ConfigAttrib(['CharacterSet'], config) == '1': | 230 if self._ConfigAttrib(['CharacterSet'], config) == '1': |
| 229 defines.extend(('_UNICODE', 'UNICODE')) | 231 defines.extend(('_UNICODE', 'UNICODE')) |
| 230 if self._ConfigAttrib(['CharacterSet'], config) == '2': | 232 if self._ConfigAttrib(['CharacterSet'], config) == '2': |
| 231 defines.append('_MBCS') | 233 defines.append('_MBCS') |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 return vs.SetupScript() | 470 return vs.SetupScript() |
| 469 | 471 |
| 470 def ExpandMacros(string, expansions): | 472 def ExpandMacros(string, expansions): |
| 471 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv | 473 """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv |
| 472 for the canonical way to retrieve a suitable dict.""" | 474 for the canonical way to retrieve a suitable dict.""" |
| 473 if '$' in string: | 475 if '$' in string: |
| 474 for old, new in expansions.iteritems(): | 476 for old, new in expansions.iteritems(): |
| 475 assert '$(' not in new, new | 477 assert '$(' not in new, new |
| 476 string = string.replace(old, new) | 478 string = string.replace(old, new) |
| 477 return string | 479 return string |
| OLD | NEW |