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

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

Issue 24792003: homogenize msvs and ninja library_dir and libraries settings for Windows (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/library_dirs/subdir/test.gyp » ('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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 replacements['$(WDK_DIR)'] = self.wdk_dir if self.wdk_dir else '' 195 replacements['$(WDK_DIR)'] = self.wdk_dir if self.wdk_dir else ''
196 return replacements 196 return replacements
197 197
198 def ConvertVSMacros(self, s, base_to_build=None, config=None): 198 def ConvertVSMacros(self, s, base_to_build=None, config=None):
199 """Convert from VS macro names to something equivalent.""" 199 """Convert from VS macro names to something equivalent."""
200 env = self.GetVSMacroEnv(base_to_build, config=config) 200 env = self.GetVSMacroEnv(base_to_build, config=config)
201 return ExpandMacros(s, env) 201 return ExpandMacros(s, env)
202 202
203 def AdjustLibraries(self, libraries): 203 def AdjustLibraries(self, libraries):
204 """Strip -l from library if it's specified with that.""" 204 """Strip -l from library if it's specified with that."""
205 return [lib[2:] if lib.startswith('-l') else lib for lib in libraries] 205 return [lib[2:] + '.lib' if lib.startswith('-l') else lib
scottmg 2013/09/26 19:50:04 Hmm, unfortunately: https://code.google.com/p/chr
206 for lib in libraries]
206 207
207 def _GetAndMunge(self, field, path, default, prefix, append, map): 208 def _GetAndMunge(self, field, path, default, prefix, append, map):
208 """Retrieve a value from |field| at |path| or return |default|. If 209 """Retrieve a value from |field| at |path| or return |default|. If
209 |append| is specified, and the item is found, it will be appended to that 210 |append| is specified, and the item is found, it will be appended to that
210 object instead of returned. If |map| is specified, results will be 211 object instead of returned. If |map| is specified, results will be
211 remapped through |map| before being returned or appended.""" 212 remapped through |map| before being returned or appended."""
212 result = _GenericRetrieve(field, default, path) 213 result = _GenericRetrieve(field, default, path)
213 result = _DoRemapping(result, map) 214 result = _DoRemapping(result, map)
214 result = _AddPrefix(result, prefix) 215 result = _AddPrefix(result, prefix)
215 return _AppendOrReturn(append, result) 216 return _AppendOrReturn(append, result)
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 so they're not surprised when the VS build fails.""" 842 so they're not surprised when the VS build fails."""
842 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): 843 if int(generator_flags.get('msvs_error_on_missing_sources', 0)):
843 no_specials = filter(lambda x: '$' not in x, sources) 844 no_specials = filter(lambda x: '$' not in x, sources)
844 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] 845 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials]
845 missing = filter(lambda x: not os.path.exists(x), relative) 846 missing = filter(lambda x: not os.path.exists(x), relative)
846 if missing: 847 if missing:
847 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the 848 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the
848 # path for a slightly less crazy looking output. 849 # path for a slightly less crazy looking output.
849 cleaned_up = [os.path.normpath(x) for x in missing] 850 cleaned_up = [os.path.normpath(x) for x in missing]
850 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) 851 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up))
OLDNEW
« no previous file with comments | « pylib/gyp/generator/ninja.py ('k') | test/library_dirs/subdir/test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698