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

Side by Side Diff: pylib/gyp/msvs_emulation.py

Issue 10371002: ninja windows: make sure there's a trailing slash on $(VCInstallDir) (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: fix quotes Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/win/gyptest-macro-vcinstalldir.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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') + '\\',
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
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
OLDNEW
« no previous file with comments | « no previous file | test/win/gyptest-macro-vcinstalldir.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698