OLD | NEW |
1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. 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 Import('env') | 5 Import('env') |
6 | 6 |
7 env = env.Clone() | 7 env = env.Clone() |
8 | 8 |
9 mksnapshot_exe = File('#/../v8/bin/debug/mksnapshot.exe') | 9 # Rather than build v8 here, we just shell out to v8's own SCons-based |
10 v8_exe = File('#/../v8/bin/release/v8.exe') | 10 # build, since their build system is complicated. |
11 v8_lib = File('#/../v8/bin/debug/v8.lib'), | 11 # This SConscript just declares dependencies on the outputs of that build. |
| 12 |
| 13 mksnapshot_bin = env.File('#/../v8/obj/release/mksnapshot${PROGSUFFIX}') |
| 14 v8_bin = env.File('#/../v8/shell${PROGSUFFIX}') |
| 15 v8_lib = env.File('#/../v8/${LIBPREFIX}v8${LIBSUFFIX}'), |
12 | 16 |
13 v8_scons_targets = [ | 17 v8_scons_targets = [ |
14 mksnapshot_exe, | 18 mksnapshot_bin, |
15 v8_exe, | 19 v8_bin, |
16 v8_lib, | 20 v8_lib, |
17 File('#/../v8/bin/debug/snapshot-empty.obj'), | |
18 File('#/../v8/vc80.pdb') | |
19 ] | 21 ] |
20 | 22 |
| 23 if env['PLATFORM'] == 'win32': |
| 24 v8_scons_targets.append([ |
| 25 env.File('#/../v8/bin/release/snapshot-empty.obj'), |
| 26 env.File('#/../v8/vc80.pdb') |
| 27 ]) |
| 28 |
| 29 # Grab the -j flag from the outer environment, if available. |
| 30 try: |
| 31 cpus = env.GetOption('num_jobs') |
| 32 cpu_flag = ' -j%d' % cpus |
| 33 except AttributeError: |
| 34 cpu_flag = '' |
| 35 |
21 v8 = env.Command(v8_scons_targets, | 36 v8 = env.Command(v8_scons_targets, |
22 [], | 37 [], |
23 'cd ..\\v8 && $PYTHON $SCONS $SCONSFLAGS ${TARGETS[:-1]}', | 38 'cd ../v8 && $PYTHON $SCONS $SCONSFLAGS snapshot=on ' + |
24 SCONS='..\\third_party\\scons\\scons.py', | 39 'sample=shell', |
25 SCONSFLAGS='-Q --warn=no-deprecated') | 40 SCONS='../third_party/scons/scons.py', |
| 41 SCONSFLAGS='-Q --warn=no-deprecated' + cpu_flag) |
26 env.AlwaysBuild(v8) | 42 env.AlwaysBuild(v8) |
27 env.Install('$V8_DIR', v8) | 43 env.Install('$V8_DIR', v8) |
28 | 44 |
29 i = env.Install('$TARGET_ROOT', mksnapshot_exe) | 45 i = env.Install('$TARGET_ROOT', mksnapshot_bin) |
30 env.Alias('webkit', i) | 46 env.Alias('webkit', i) |
31 | 47 |
32 i = env.Install('$LIBS_DIR', v8_lib) | 48 i = env.Install('$LIBS_DIR', v8_lib) |
33 env.Alias('webkit', i) | 49 env.Alias('webkit', i) |
34 | 50 |
35 i = env.Install('$TARGET_ROOT', v8_exe) | 51 i = env.Install('$TARGET_ROOT', v8_bin) |
36 env.Alias('chrome', i) | 52 env.Alias('chrome', i) |
37 | 53 |
38 # To satisfy tests expecting the following .exe name. | 54 # To satisfy tests expecting the following .exe name. |
39 i = env.InstallAs('$TARGET_ROOT/v8_shell_sample.exe', v8_exe) | 55 if env['PLATFORM'] == 'win32': |
40 env.Alias('chrome', i) | 56 # TODO(evanm): this may be necessary on other platforms(?) |
| 57 i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8_bin) |
| 58 env.Alias('chrome', i) |
41 | 59 |
42 # Tell our SCons invocation to *not* delete v8.lib and the other targets | 60 # Tell our SCons invocation to *not* delete v8.lib and the other targets |
43 # before building them, so the subsidiary v8 SCons call doesn't always | 61 # before building them, so the subsidiary v8 SCons call doesn't always |
44 # rebuild them (thereby causing us to always rebuild their dependents). | 62 # rebuild them (thereby causing us to always rebuild their dependents). |
45 env.Precious(v8) | 63 env.Precious(v8) |
OLD | NEW |