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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return output_file | 327 return output_file |
328 | 328 |
329 def GetCflags(self, config): | 329 def GetCflags(self, config): |
330 """Returns the flags that need to be added to .c and .cc compilations.""" | 330 """Returns the flags that need to be added to .c and .cc compilations.""" |
331 config = self._TargetConfig(config) | 331 config = self._TargetConfig(config) |
332 cflags = [] | 332 cflags = [] |
333 cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) | 333 cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) |
334 cl = self._GetWrapper(self, self.msvs_settings[config], | 334 cl = self._GetWrapper(self, self.msvs_settings[config], |
335 'VCCLCompilerTool', append=cflags) | 335 'VCCLCompilerTool', append=cflags) |
336 cl('Optimization', | 336 cl('Optimization', |
337 map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O') | 337 map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2') |
338 cl('InlineFunctionExpansion', prefix='/Ob') | 338 cl('InlineFunctionExpansion', prefix='/Ob') |
339 cl('StringPooling', map={'true': '/GF'}) | 339 cl('StringPooling', map={'true': '/GF'}) |
340 cl('EnableFiberSafeOptimizations', map={'true': '/GT'}) | 340 cl('EnableFiberSafeOptimizations', map={'true': '/GT'}) |
341 cl('OmitFramePointers', map={'false': '-', 'true': ''}, prefix='/Oy') | 341 cl('OmitFramePointers', map={'false': '-', 'true': ''}, prefix='/Oy') |
342 cl('EnableIntrinsicFunctions', map={'false': '-', 'true': ''}, prefix='/Oi') | 342 cl('EnableIntrinsicFunctions', map={'false': '-', 'true': ''}, prefix='/Oi') |
343 cl('FavorSizeOrSpeed', map={'1': 't', '2': 's'}, prefix='/O') | 343 cl('FavorSizeOrSpeed', map={'1': 't', '2': 's'}, prefix='/O') |
344 cl('WholeProgramOptimization', map={'true': '/GL'}) | 344 cl('WholeProgramOptimization', map={'true': '/GL'}) |
345 cl('WarningLevel', prefix='/W') | 345 cl('WarningLevel', prefix='/W') |
346 cl('WarnAsError', map={'true': '/WX'}) | 346 cl('WarnAsError', map={'true': '/WX'}) |
347 cl('DebugInformationFormat', | 347 cl('DebugInformationFormat', |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 so they're not surprised when the VS build fails.""" | 837 so they're not surprised when the VS build fails.""" |
838 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): | 838 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): |
839 no_specials = filter(lambda x: '$' not in x, sources) | 839 no_specials = filter(lambda x: '$' not in x, sources) |
840 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] | 840 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] |
841 missing = filter(lambda x: not os.path.exists(x), relative) | 841 missing = filter(lambda x: not os.path.exists(x), relative) |
842 if missing: | 842 if missing: |
843 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the | 843 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the |
844 # path for a slightly less crazy looking output. | 844 # path for a slightly less crazy looking output. |
845 cleaned_up = [os.path.normpath(x) for x in missing] | 845 cleaned_up = [os.path.normpath(x) for x in missing] |
846 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) | 846 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) |
OLD | NEW |