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

Unified Diff: BUILD.gn

Issue 2011853002: [gn] Add unittests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clean up Created 4 years, 7 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 | build_overrides/gtest.gni » ('j') | test/unittests/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 82023a4add3362f46abc61738c6608a66fc35ca9..13940c01ade4305abb7a678978209775d92e146e 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
#
@@ -643,6 +634,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.
@@ -2002,7 +2004,7 @@ v8_source_set("fuzzer_support") {
configs = [ ":internal_config_base" ]
deps = [
- snapshot_target,
+ ":v8_maybe_snapshot",
]
public_deps = [
@@ -2044,6 +2046,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 = [
@@ -2052,7 +2081,7 @@ if (is_component_build) {
public_deps = [
":v8_base",
- snapshot_target,
+ ":v8_maybe_snapshot",
]
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -2069,7 +2098,7 @@ if (is_component_build) {
group("v8") {
public_deps = [
":v8_base",
- snapshot_target,
+ ":v8_maybe_snapshot",
]
public_configs = [ ":external_config" ]
}
@@ -2116,10 +2145,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",
« no previous file with comments | « no previous file | build_overrides/gtest.gni » ('j') | test/unittests/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698