Commit 8e05308e authored by jochen@chromium.org's avatar jochen@chromium.org

First cut at run_mksnapshot action for gn

BUG=none
R=brettw@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/293363009

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2a2874b9
......@@ -15,9 +15,10 @@ v8_interpreted_regexp = false
v8_object_print = false
v8_postmortem_support = false
v8_use_default_platform = true
#v8_use_snapshot = true
v8_use_snapshot = true
v8_enable_extra_checks = is_debug
v8_target_arch = cpu_arch
v8_random_seed = "314159265"
###############################################################################
......@@ -185,6 +186,8 @@ action("js2c") {
"src/regexp.js",
"src/arraybuffer.js",
"src/typedarray.js",
"src/weak_collection.js",
"src/promise.js",
"src/object-observe.js",
"src/macros.py",
]
......@@ -199,7 +202,7 @@ action("js2c") {
args =
rebase_path(outputs, root_build_dir) +
[ "EXPERIMENTAL", v8_compress_startup_data ] +
[ "CORE", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
......@@ -217,8 +220,6 @@ action("js2c_experimental") {
"src/symbol.js",
"src/proxy.js",
"src/collection.js",
"src/weak_collection.js",
"src/promise.js",
"src/generator.js",
"src/array-iterator.js",
"src/harmony-string.js",
......@@ -232,7 +233,7 @@ action("js2c_experimental") {
args =
rebase_path(outputs, root_build_dir) +
[ "CORE", v8_compress_startup_data ] +
[ "EXPERIMENTAL", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
......@@ -255,6 +256,33 @@ action("postmortem-metadata") {
rebase_path(sources, root_build_dir)
}
action("run_mksnapshot") {
visibility = ":*" # Only targets in this file can depend on this.
deps = [ ":mksnapshot($host_toolchain)" ]
script = "tools/run.py"
outputs = [
"$target_gen_dir/snapshot.cc"
]
args = [
"./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)",
"root_out_dir") + "/mksnapshot",
root_build_dir),
"--log-snapshot-positions",
"--logfile", rebase_path("$target_gen_dir/snapshot.log", root_build_dir)
]
if (v8_random_seed != "0") {
args += [ "--random-seed", v8_random_seed ]
}
args += rebase_path(outputs, root_build_dir)
}
###############################################################################
# Source Sets (aka static libraries)
#
......@@ -281,6 +309,29 @@ source_set("v8_nosnapshot") {
configs += [ ":internal_config", ":features", ":toolchain" ]
}
source_set("v8_snapshot") {
visibility = ":*" # Only targets in this file can depend on this.
deps = [
":js2c",
":js2c_experimental",
":generate_trig_table",
":run_mksnapshot",
":v8_base",
]
sources = [
"$target_gen_dir/libraries.cc",
"$target_gen_dir/experimental-libraries.cc",
"$target_gen_dir/trig-table.cc",
"$target_gen_dir/snapshot.cc",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features", ":toolchain" ]
}
source_set("v8_base") {
visibility = ":*" # Only targets in this file can depend on this.
......@@ -908,16 +959,9 @@ source_set("v8_libbase") {
# Executables
#
if (current_toolchain != host_toolchain && is_android) {
source_set("mksnapshot") {
sources = [
]
}
} else {
executable("mksnapshot") {
visibility = ":*" # Only targets in this file can depend on this.
sources = [
"src/mksnapshot.cc",
]
......@@ -936,7 +980,55 @@ executable("mksnapshot") {
}
}
###############################################################################
# Public targets
#
if (component_mode == "shared_library") {
component("v8") {
sources = [
"src/v8dll-main.cc",
]
if (v8_use_snapshot) {
deps = [
":v8_base",
":v8_snapshot",
]
} else {
deps = [
":v8_base",
":v8_nosnapshot",
]
}
if (is_android && current_toolchain != host_toolchain) {
libs = [ "log" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features", ":toolchain" ]
# TODO(jochen): Support direct dependent configs.
}
} else {
group("v8") {
if (v8_use_snapshot) {
deps = [
":v8_base",
":v8_snapshot",
]
} else {
deps = [
":v8_base",
":v8_nosnapshot",
]
}
# TODO(jochen): Support direct dependent configs.
}
}
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This program wraps an arbitrary command since gn currently can only execute
scripts."""
import subprocess
import sys
sys.exit(subprocess.call(sys.argv[1:]))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment