Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index 7fb39d53e805f3cef8126ea427a4463568f0a88d..16ab02148a2ed105d70579388e84ee8eed0145f5 100644 |
--- a/BUILD.gn |
+++ b/BUILD.gn |
@@ -69,15 +69,6 @@ declare_args() { |
v8_random_seed = "314159265" |
v8_toolset_for_shell = "host" |
-if (v8_use_snapshot && v8_use_external_startup_data) { |
- snapshot_target = ":v8_external_snapshot" |
-} else if (v8_use_snapshot) { |
- snapshot_target = ":v8_snapshot" |
-} else { |
- assert(!v8_use_external_startup_data) |
- snapshot_target = ":v8_nosnapshot" |
-} |
- |
############################################################################### |
# Configurations |
# |
@@ -641,6 +632,17 @@ action("run_mksnapshot") { |
# Source Sets (aka static libraries) |
# |
+source_set("v8_maybe_snapshot") { |
+ if (v8_use_snapshot && v8_use_external_startup_data) { |
+ public_deps = [ ":v8_external_snapshot" ] |
+ } else if (v8_use_snapshot) { |
+ public_deps = [ ":v8_snapshot" ] |
+ } else { |
+ assert(!v8_use_external_startup_data) |
+ public_deps = [ ":v8_nosnapshot" ] |
+ } |
+} |
+ |
v8_source_set("v8_nosnapshot") { |
visibility = [ ":*" ] # Only targets in this file can depend on this. |
@@ -2000,7 +2002,7 @@ v8_source_set("fuzzer_support") { |
configs = [ ":internal_config_base" ] |
deps = [ |
- snapshot_target, |
+ ":v8_maybe_snapshot", |
] |
public_deps = [ |
@@ -2042,6 +2044,33 @@ if (current_toolchain == v8_snapshot_toolchain) { |
# Public targets |
# |
+want_v8_shell = ( |
+ (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || |
+ (current_toolchain == v8_snapshot_toolchain && |
+ v8_toolset_for_shell == "host") || |
+ (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")) |
+ |
+group("gn_all") { |
+ testonly = true |
+ |
+ deps = [ |
+ ":d8", |
+ ] |
+ |
+ if (want_v8_shell) { |
+ deps += [ |
+ ":v8_shell", |
+ ] |
+ } |
+ |
+ if (host_os != "mac" || !is_android) { |
+ # These items don't compile for Android on Mac. |
+ deps += [ |
+ "test/unittests:unittests", |
+ ] |
+ } |
+} |
+ |
if (is_component_build) { |
component("v8") { |
sources = [ |
@@ -2050,7 +2079,7 @@ if (is_component_build) { |
public_deps = [ |
":v8_base", |
- snapshot_target, |
+ ":v8_maybe_snapshot", |
] |
configs -= [ "//build/config/compiler:chromium_code" ] |
@@ -2067,7 +2096,7 @@ if (is_component_build) { |
group("v8") { |
public_deps = [ |
":v8_base", |
- snapshot_target, |
+ ":v8_maybe_snapshot", |
] |
public_configs = [ ":external_config" ] |
} |
@@ -2114,10 +2143,7 @@ executable("d8") { |
} |
} |
-if ((current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || |
- (current_toolchain == v8_snapshot_toolchain && |
- v8_toolset_for_shell == "host") || |
- (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")) { |
+if (want_v8_shell) { |
executable("v8_shell") { |
sources = [ |
"samples/shell.cc", |