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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 cl('RuntimeLibrary', | 354 cl('RuntimeLibrary', |
355 map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') | 355 map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') |
356 cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') | 356 cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') |
357 cl('DefaultCharIsUnsigned', map={'true': '/J'}) | 357 cl('DefaultCharIsUnsigned', map={'true': '/J'}) |
358 cl('TreatWChar_tAsBuiltInType', | 358 cl('TreatWChar_tAsBuiltInType', |
359 map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') | 359 map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') |
360 cl('EnablePREfast', map={'true': '/analyze'}) | 360 cl('EnablePREfast', map={'true': '/analyze'}) |
361 cl('AdditionalOptions', prefix='') | 361 cl('AdditionalOptions', prefix='') |
362 cflags.extend(['/FI' + f for f in self._Setting( | 362 cflags.extend(['/FI' + f for f in self._Setting( |
363 ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) | 363 ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) |
364 if self.vs_version.short_name == '2013' or self.vs_version == '2013e': | |
365 # New flag required in 2013 to maintain previous PDB behavior. | |
Nico
2013/09/12 17:23:21
What's the new behavior do?
| |
366 cflags.append('/FS') | |
364 # ninja handles parallelism by itself, don't have the compiler do it too. | 367 # ninja handles parallelism by itself, don't have the compiler do it too. |
365 cflags = filter(lambda x: not x.startswith('/MP'), cflags) | 368 cflags = filter(lambda x: not x.startswith('/MP'), cflags) |
366 return cflags | 369 return cflags |
367 | 370 |
368 def GetPrecompiledHeader(self, config, gyp_to_build_path): | 371 def GetPrecompiledHeader(self, config, gyp_to_build_path): |
369 """Returns an object that handles the generation of precompiled header | 372 """Returns an object that handles the generation of precompiled header |
370 build steps.""" | 373 build steps.""" |
371 config = self._TargetConfig(config) | 374 config = self._TargetConfig(config) |
372 return _PchHelper(self, config, gyp_to_build_path) | 375 return _PchHelper(self, config, gyp_to_build_path) |
373 | 376 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 so they're not surprised when the VS build fails.""" | 840 so they're not surprised when the VS build fails.""" |
838 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): | 841 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): |
839 no_specials = filter(lambda x: '$' not in x, sources) | 842 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] | 843 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) | 844 missing = filter(lambda x: not os.path.exists(x), relative) |
842 if missing: | 845 if missing: |
843 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the | 846 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the |
844 # path for a slightly less crazy looking output. | 847 # path for a slightly less crazy looking output. |
845 cleaned_up = [os.path.normpath(x) for x in missing] | 848 cleaned_up = [os.path.normpath(x) for x in missing] |
846 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) | 849 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) |
OLD | NEW |