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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 if rule.get('process_outputs_as_sources'): | 387 if rule.get('process_outputs_as_sources'): |
388 fp.write(' input_files.Replace(%s_file, _outputs)\n' % name) | 388 fp.write(' input_files.Replace(%s_file, _outputs)\n' % name) |
389 fp.write('prerequisites.extend(_outputs)\n') | 389 fp.write('prerequisites.extend(_outputs)\n') |
390 | 390 |
391 SConsTypeWriter[spec.get('type')](fp, spec) | 391 SConsTypeWriter[spec.get('type')](fp, spec) |
392 | 392 |
393 copies = spec.get('copies', []) | 393 copies = spec.get('copies', []) |
394 for copy in copies: | 394 for copy in copies: |
395 destdir = copy['destination'] | 395 destdir = copy['destination'] |
396 files = copy['files'] | 396 files = copy['files'] |
397 fmt = '\n_outputs = env.Command(%s,\n %s\n, \'cp $SOURCE $TARGET\')\n' | 397 opts = '' |
| 398 # TODO(mmoss) Maybe make the "-d" configurable? How would a |
| 399 # "no-dereference" copies option work in other generators? |
| 400 fmt = '\n_outputs = env.Command(%s,\n %s\n, \'cp -d $SOURCE $TARGET\')
\n' |
398 for f in copy['files']: | 401 for f in copy['files']: |
399 dest = os.path.join(destdir, os.path.split(f)[1]) | 402 dest = os.path.join(destdir, os.path.split(f)[1]) |
400 fp.write(fmt % (repr(dest), repr(f))) | 403 fp.write(fmt % (repr(dest), repr(f))) |
401 fp.write('target_files.extend(_outputs)\n') | 404 fp.write('target_files.extend(_outputs)\n') |
402 | 405 |
403 fmt = "\ngyp_target = env.Alias('%s', target_files)\n" | 406 fmt = "\ngyp_target = env.Alias('%s', target_files)\n" |
404 fp.write(fmt % target_name) | 407 fp.write(fmt % target_name) |
405 dependencies = spec.get('scons_dependencies', []) | 408 dependencies = spec.get('scons_dependencies', []) |
406 if dependencies: | 409 if dependencies: |
407 WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', | 410 WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 if target_dicts[t]['type'] == 'settings': | 744 if target_dicts[t]['type'] == 'settings': |
742 continue | 745 continue |
743 bf, target = gyp.common.BuildFileAndTarget('', t)[:2] | 746 bf, target = gyp.common.BuildFileAndTarget('', t)[:2] |
744 target_filename = TargetFilename(target, bf, options.suffix) | 747 target_filename = TargetFilename(target, bf, options.suffix) |
745 tpath = gyp.common.RelativePath(target_filename, output_dir) | 748 tpath = gyp.common.RelativePath(target_filename, output_dir) |
746 sconscript_files[target] = tpath | 749 sconscript_files[target] = tpath |
747 | 750 |
748 if sconscript_files: | 751 if sconscript_files: |
749 GenerateSConscriptWrapper(data[build_file], basename, | 752 GenerateSConscriptWrapper(data[build_file], basename, |
750 output_filename, sconscript_files) | 753 output_filename, sconscript_files) |
OLD | NEW |