OLD | NEW |
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 'cctest': cctest_flags, | 567 'cctest': cctest_flags, |
568 'sample': sample_flags, | 568 'sample': sample_flags, |
569 'd8': d8_flags | 569 'd8': d8_flags |
570 } | 570 } |
571 | 571 |
572 target_id = mode | 572 target_id = mode |
573 suffix = SUFFIXES[target_id] | 573 suffix = SUFFIXES[target_id] |
574 library_name = 'v8' + suffix | 574 library_name = 'v8' + suffix |
575 env['LIBRARY'] = library_name | 575 env['LIBRARY'] = library_name |
576 | 576 |
577 # Build the object files by invoking SCons recursively. | 577 # Build the object files by invoking SCons recursively. |
578 (object_files, shell_files, mksnapshot) = env.SConscript( | 578 (object_files, shell_files, mksnapshot) = env.SConscript( |
579 join('src', 'SConscript'), | 579 join('src', 'SConscript'), |
580 build_dir=join('obj', target_id), | 580 build_dir=join('obj', target_id), |
581 exports='context', | 581 exports='context', |
582 duplicate=False | 582 duplicate=False |
583 ) | 583 ) |
584 | 584 |
585 context.mksnapshot_targets.append(mksnapshot) | 585 context.mksnapshot_targets.append(mksnapshot) |
586 | 586 |
587 # Link the object files into a library. | 587 # Link the object files into a library. |
588 env.Replace(**context.flags['v8']) | 588 env.Replace(**context.flags['v8']) |
589 context.ApplyEnvOverrides(env) | 589 context.ApplyEnvOverrides(env) |
590 if context.options['library'] == 'static': | 590 if context.options['library'] == 'static': |
591 library = env.StaticLibrary(library_name, object_files) | 591 library = env.StaticLibrary(library_name, object_files) |
592 else: | 592 else: |
593 # There seems to be a glitch in the way scons decides where to put | 593 # There seems to be a glitch in the way scons decides where to put |
594 # PDB files when compiling using MSVC so we specify it manually. | 594 # PDB files when compiling using MSVC so we specify it manually. |
595 # This should not affect any other platforms. | 595 # This should not affect any other platforms. |
596 pdb_name = library_name + '.dll.pdb' | 596 pdb_name = library_name + '.dll.pdb' |
597 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) | 597 library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) |
598 context.library_targets.append(library) | 598 context.library_targets.append(library) |
599 | 599 |
600 d8_env = Environment() | 600 d8_env = Environment() |
601 d8_env.Replace(**context.flags['d8']) | 601 d8_env.Replace(**context.flags['d8']) |
602 shell = d8_env.Program('d8' + suffix, object_files + shell_files) | 602 shell = d8_env.Program('d8' + suffix, object_files + shell_files) |
603 context.d8_targets.append(shell) | 603 context.d8_targets.append(shell) |
604 | 604 |
605 for sample in context.samples: | 605 for sample in context.samples: |
606 sample_env = Environment(LIBRARY=library_name) | 606 sample_env = Environment(LIBRARY=library_name) |
607 sample_env.Replace(**context.flags['sample']) | 607 sample_env.Replace(**context.flags['sample']) |
608 context.ApplyEnvOverrides(sample_env) | 608 context.ApplyEnvOverrides(sample_env) |
609 sample_object = sample_env.SConscript( | 609 sample_object = sample_env.SConscript( |
610 join('samples', 'SConscript'), | 610 join('samples', 'SConscript'), |
611 build_dir=join('obj', 'sample', sample, target_id), | 611 build_dir=join('obj', 'sample', sample, target_id), |
612 exports='sample context', | 612 exports='sample context', |
613 duplicate=False | 613 duplicate=False |
614 ) | 614 ) |
615 sample_name = sample + suffix | 615 sample_name = sample + suffix |
616 sample_program = sample_env.Program(sample_name, sample_object) | 616 sample_program = sample_env.Program(sample_name, sample_object) |
617 sample_env.Depends(sample_program, library) | 617 sample_env.Depends(sample_program, library) |
618 context.sample_targets.append(sample_program) | 618 context.sample_targets.append(sample_program) |
619 | 619 |
620 cctest_program = env.SConscript( | 620 cctest_program = env.SConscript( |
621 join('test', 'cctest', 'SConscript'), | 621 join('test', 'cctest', 'SConscript'), |
622 build_dir=join('obj', 'test', target_id), | 622 build_dir=join('obj', 'test', target_id), |
623 exports='context object_files', | 623 exports='context object_files', |
624 duplicate=False | 624 duplicate=False |
625 ) | 625 ) |
626 context.cctest_targets.append(cctest_program) | 626 context.cctest_targets.append(cctest_program) |
627 | 627 |
628 return context | 628 return context |
629 | 629 |
630 | 630 |
631 def Build(): | 631 def Build(): |
632 opts = GetOptions() | 632 opts = GetOptions() |
633 env = Environment(options=opts) | 633 env = Environment(options=opts) |
634 Help(opts.GenerateHelpText(env)) | 634 Help(opts.GenerateHelpText(env)) |
635 VerifyOptions(env) | 635 VerifyOptions(env) |
636 env_overrides = ParseEnvOverrides(env['env']) | 636 env_overrides = ParseEnvOverrides(env['env']) |
637 | 637 |
(...skipping 30 matching lines...) Expand all Loading... |
668 # version of scons. Also, there's a bug in some revisions that | 668 # version of scons. Also, there's a bug in some revisions that |
669 # doesn't allow this flag to be set, so we swallow any exceptions. | 669 # doesn't allow this flag to be set, so we swallow any exceptions. |
670 # Lovely. | 670 # Lovely. |
671 try: | 671 try: |
672 SetOption('warn', 'no-deprecated') | 672 SetOption('warn', 'no-deprecated') |
673 except: | 673 except: |
674 pass | 674 pass |
675 | 675 |
676 | 676 |
677 Build() | 677 Build() |
OLD | NEW |