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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
683 args = vs.SetupScript(arch) | 683 args = vs.SetupScript(arch) |
684 args.extend(('&&', 'set')) | 684 args.extend(('&&', 'set')) |
685 popen = subprocess.Popen( | 685 popen = subprocess.Popen( |
686 args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 686 args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
687 variables, _ = popen.communicate() | 687 variables, _ = popen.communicate() |
688 env = _ExtractImportantEnvironment(variables) | 688 env = _ExtractImportantEnvironment(variables) |
689 env_block = _FormatAsEnvironmentBlock(env) | 689 env_block = _FormatAsEnvironmentBlock(env) |
690 f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') | 690 f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') |
691 f.write(env_block) | 691 f.write(env_block) |
692 f.close() | 692 f.close() |
693 | |
694 def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): | |
695 """Emulate behaviour of msvs_error_on_missing_sources present in the msvs | |
696 generator.""" | |
Nico
2012/10/31 01:16:07
nit 1: docstring could be more descriptive
nit 2:
scottmg
2012/10/31 01:23:02
Done.
| |
697 if int(generator_flags.get('msvs_error_on_missing_sources', 0)): | |
698 no_specials = filter(lambda x: '$' not in x, sources) | |
699 relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] | |
700 missing = filter(lambda x: not os.path.exists(x), relative) | |
701 if missing: | |
702 # They'll look like out\Release\..\..\stuff\things.cc, so normalize the | |
703 # path for a slightly less crazy looking output. | |
704 cleaned_up = [os.path.normpath(x) for x in missing] | |
705 raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) | |
OLD | NEW |