Chromium Code Reviews| Index: pylib/gyp/msvs_emulation.py |
| =================================================================== |
| --- pylib/gyp/msvs_emulation.py (revision 1525) |
| +++ pylib/gyp/msvs_emulation.py (working copy) |
| @@ -690,3 +690,16 @@ |
| f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') |
| f.write(env_block) |
| f.close() |
| + |
| +def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): |
| + """Emulate behaviour of msvs_error_on_missing_sources present in the msvs |
| + 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.
|
| + if int(generator_flags.get('msvs_error_on_missing_sources', 0)): |
| + no_specials = filter(lambda x: '$' not in x, sources) |
| + relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] |
| + missing = filter(lambda x: not os.path.exists(x), relative) |
| + if missing: |
| + # They'll look like out\Release\..\..\stuff\things.cc, so normalize the |
| + # path for a slightly less crazy looking output. |
| + cleaned_up = [os.path.normpath(x) for x in missing] |
| + raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) |