Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: BUILD.gn

Issue 846743004: Add d8 target to BUILD.gn (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 1be045c483b1061a33a7cab5fae3c473c958d08d..1605495e6848228df12d8bdfcbb27348ff2fb1e0 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -20,6 +20,7 @@ v8_postmortem_support = false
v8_use_snapshot = true
v8_target_arch = cpu_arch
v8_random_seed = "314159265"
+v8_toolset_for_d8 = "host"
###############################################################################
# Configurations
@@ -233,6 +234,24 @@ action("js2c_experimental") {
}
}
+action("d8_js2c") {
+ visibility = [ ":*" ] # Only targets in this file can depend on this.
+
+ script = "tools/js2c.py"
+
+ inputs = [
+ "src/d8.js",
+ "src/macros.py",
+ ]
+
+ outputs = [
+ "$target_gen_dir/d8-js.cc",
+ ]
+
+ args = rebase_path(outputs, root_build_dir) + [ "D8" ] +
+ rebase_path(inputs, root_build_dir)
+}
+
if (v8_use_external_startup_data) {
action("natives_blob") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
@@ -1474,3 +1493,46 @@ if (component_mode == "shared_library") {
direct_dependent_configs = [ ":external_config" ]
}
}
+
+if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") ||
+ (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) {
+ executable("d8") {
+ sources = [
+ "src/d8.cc",
+ "src/d8.h",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [
+ ":internal_config",
+ ":features",
+ ":toolchain",
+ ]
+
+ deps = [
+ ":d8_js2c",
+ ":v8",
+ ":v8_libplatform",
+ "//build/config/sanitizers:deps",
+ ]
+
+ # TODO(jochen): Add support for readline and vtunejit.
+
+ if (is_posix) {
+ sources += [ "src/d8-posix.cc" ]
+ } else if (is_win) {
+ sources += [ "src/d8-windows.cc" ]
+ }
+
+ if (component_mode != "shared_library") {
+ sources += [
+ "src/d8-debug.cc",
+ "$target_gen_dir/d8-js.cc",
+ ]
+ }
+ if (v8_enable_i18n_support) {
+ deps += [ "//third_party/icu" ]
+ }
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698