diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 00:11:18 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 00:11:18 +0000 |
commit | fade961924918355e597265f40ea09e401b07c84 (patch) | |
tree | 44f432a607ec2c91330a06696367a3d871476be6 /build/SConscript.v8 | |
parent | e2c1a2202d96e044a93049d101066c509760d53b (diff) | |
download | chromium_src-fade961924918355e597265f40ea09e401b07c84.zip chromium_src-fade961924918355e597265f40ea09e401b07c84.tar.gz chromium_src-fade961924918355e597265f40ea09e401b07c84.tar.bz2 |
Use SCons -C to invoke the v8 build from our own build directory,
using the -Y option to pull all source files from the v8 source
directory. This requires making sure the build directory exists
before we invoke the subsidiary SCons that will chdir there.
Other clean up:
* Use the actual file names involved instead of local Python variables.
* Don't forcibly add our targets to other component's Aliases.
Review URL: http://codereview.chromium.org/8639
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/SConscript.v8')
-rw-r--r-- | build/SConscript.v8 | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/build/SConscript.v8 b/build/SConscript.v8 index a3eb983..8469c63 100644 --- a/build/SConscript.v8 +++ b/build/SConscript.v8 @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os + Import('env') # Grab the -j flag from the outer environment, if available. @@ -13,11 +15,12 @@ except AttributeError: env = env.Clone( V8_MODE = 'release', - V8_SRC_DIR = '$CHROME_SRC_DIR/v8', - V8_MODE_DIR = '$V8_SRC_DIR/obj/$V8_MODE', - V8_SCONS_COM = 'cd $CHROME_SRC_DIR/v8 && $PYTHON $SCONS $SCONSFLAGS mode=$V8_MODE', + V8_MODE_DIR = '$V8_DIR/obj/$V8_MODE', + V8_SCONS_COM = '$PYTHON $SCONS $SCONSFLAGS mode=$V8_MODE', SCONS='$CHROME_SRC_DIR/third_party/scons/scons.py', SCONSFLAGS = ('-Q ' + '-C $OBJ_ROOT/v8 ' + '-Y $CHROME_SRC_DIR/v8 ' '--warn=no-deprecated ' '--warn=no-no-parallel-support' + cpu_flag), ) @@ -25,31 +28,30 @@ env = env.Clone( # Rather than build v8 with our own commands, we just shell out to v8's # own SCons-based build, since their build system is complicated. # This SConscript just declares dependencies on the outputs of that build. +# +# Arrange to make sure the build directory exists, since the subsidiary +# SCons we invoke will chdir there of its own accord. + +if not os.path.exists(env.Dir('$OBJ_ROOT/v8').abspath): + Mkdir(env.Dir('$OBJ_ROOT/v8').abspath) -mksnapshot_exe = env.File('$V8_MODE_DIR/mksnapshot${PROGSUFFIX}') -libraries_obj = env.File('$V8_MODE_DIR/libraries${OBJSUFFIX}') -libraries_empty_obj = env.File('$V8_MODE_DIR/libraries-empty${OBJSUFFIX}') -snapshot_obj = env.File('$V8_MODE_DIR/snapshot${OBJSUFFIX}') -snapshot_empty_obj = env.File('$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}') -v8_bin = env.File('$V8_SRC_DIR/shell${PROGSUFFIX}') -v8_lib = env.File('$V8_SRC_DIR/${LIBPREFIX}v8${LIBSUFFIX}'), v8_scons_targets_off = [ - mksnapshot_exe, - libraries_obj, - snapshot_empty_obj, - v8_bin, - v8_lib, + '$V8_DIR/shell${PROGSUFFIX}', + '$V8_DIR/${LIBPREFIX}v8${LIBSUFFIX}', + '$V8_MODE_DIR/mksnapshot${PROGSUFFIX}', + '$V8_MODE_DIR/libraries${OBJSUFFIX}', + '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}', ] v8_scons_targets_on = [ - libraries_empty_obj, - snapshot_obj, + '$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', + '$V8_MODE_DIR/snapshot${OBJSUFFIX}', ] if env['PLATFORM'] == 'win32': v8_scons_targets_off.extend([ - env.File('$CHROME_SRC_DIR/v8/vc80.pdb') + env.File('$V8_DIR/vc80.pdb') ]) v8 = env.Command(v8_scons_targets_off + v8_scons_targets_on, @@ -64,20 +66,17 @@ env.AlwaysBuild(v8) # rebuild them (thereby causing us to always rebuild their dependents). env.Precious(v8) -env.Install('$V8_DIR', v8) - -i = env.Install('$LIBS_DIR', v8_lib) -env.Alias('webkit', i) -i = env.Install('$TARGET_ROOT', v8_bin) -env.Alias('chrome', i) +env.Install('$TARGET_ROOT', v8[0]) +env.Install('$LIB_DIR', v8[1]) +env.Install('$V8_DIR', '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}') # To satisfy tests expecting the following .exe name. if env['PLATFORM'] == 'win32': # TODO(evanm): this may be necessary on other platforms(?) - i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8_bin) - env.Alias('chrome', i) + i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8[0]) env.ChromeStaticLibrary('v8_snapshot', - [libraries_empty_obj, snapshot_obj]) + ['$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', + '$V8_MODE_DIR/snapshot${OBJSUFFIX}']) |