| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 | 3 |
| 4 import gyp | 4 import gyp |
| 5 import gyp.common | 5 import gyp.common |
| 6 # TODO(sgk): create a separate "project module" for SCons? | 6 # TODO(sgk): create a separate "project module" for SCons? |
| 7 #import gyp.SCons as SCons | 7 #import gyp.SCons as SCons |
| 8 import os.path | 8 import os.path |
| 9 import pprint | 9 import pprint |
| 10 import re | 10 import re |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 message = repr(message) | 357 message = repr(message) |
| 358 fp.write(_rule_template % { | 358 fp.write(_rule_template % { |
| 359 'inputs' : pprint.pformat(rule.get('inputs', [])), | 359 'inputs' : pprint.pformat(rule.get('inputs', [])), |
| 360 'outputs' : pprint.pformat(rule.get('outputs', [])), | 360 'outputs' : pprint.pformat(rule.get('outputs', [])), |
| 361 'action' : pprint.pformat(a), | 361 'action' : pprint.pformat(a), |
| 362 'extension' : rule['extension'], | 362 'extension' : rule['extension'], |
| 363 'name' : name, | 363 'name' : name, |
| 364 'message' : message, | 364 'message' : message, |
| 365 }) | 365 }) |
| 366 if rule.get('process_outputs_as_sources'): | 366 if rule.get('process_outputs_as_sources'): |
| 367 fp.write(' input_files.Replace(%s_file, _outputs)\n' % name) | 367 # Remove header files so we don't add them to inputs and try to link them. |
| 368 fp.write(' linkable_files = [f for f in _outputs if not str(f).endswith(\
'.h\')]\n') |
| 369 fp.write(' input_files.Replace(%s_file, linkable_files)\n' % name) |
| 370 else: |
| 371 # Remove the source file e.g. the gperf file to avoid trying to link it. |
| 372 fp.write(' input_files.Remove(%s_file)\n' % name) |
| 368 fp.write('prerequisites.extend(_outputs)\n') | 373 fp.write('prerequisites.extend(_outputs)\n') |
| 369 | 374 |
| 370 SConsTypeWriter[spec.get('type')](fp, spec) | 375 SConsTypeWriter[spec.get('type')](fp, spec) |
| 371 | 376 |
| 372 copies = spec.get('copies', []) | 377 copies = spec.get('copies', []) |
| 373 for copy in copies: | 378 for copy in copies: |
| 374 destdir = copy['destination'] | 379 destdir = copy['destination'] |
| 375 files = copy['files'] | 380 files = copy['files'] |
| 376 fmt = '\n_outputs = env.Command(%s,\n %s\n, \'cp $SOURCE $TARGET\')\n' | 381 fmt = '\n_outputs = env.Command(%s,\n %s\n, \'cp $SOURCE $TARGET\')\n' |
| 377 for f in copy['files']: | 382 for f in copy['files']: |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 if target_dicts[t]['type'] == 'settings': | 647 if target_dicts[t]['type'] == 'settings': |
| 643 continue | 648 continue |
| 644 bf, target = gyp.common.BuildFileAndTarget('', t)[:2] | 649 bf, target = gyp.common.BuildFileAndTarget('', t)[:2] |
| 645 target_filename = TargetFilename(target, bf, options.suffix) | 650 target_filename = TargetFilename(target, bf, options.suffix) |
| 646 tpath = gyp.common.RelativePath(target_filename, output_dir) | 651 tpath = gyp.common.RelativePath(target_filename, output_dir) |
| 647 sconscript_files[target] = tpath | 652 sconscript_files[target] = tpath |
| 648 | 653 |
| 649 if sconscript_files: | 654 if sconscript_files: |
| 650 GenerateSConscriptWrapper(data[build_file], basename, | 655 GenerateSConscriptWrapper(data[build_file], basename, |
| 651 output_filename, sconscript_files) | 656 output_filename, sconscript_files) |
| OLD | NEW |