Properly define v8_enable_inspector and its override in GN.

Instead of directly using v8_enable_inspector_override from
build_overrides/v8.gni in all the GN configs, set a v8_enable_inspector
variable based on v8_enable_inspector_override and use that everywhere.
This is the more common pattern seen in over projects, and reduces the
need to include //build_overrides/v8.gni in many files.

Review-Url: https://codereview.chromium.org/2520683002
Cr-Commit-Position: refs/heads/master@{#41156}
This commit is contained in:
thestig 2016-11-21 11:29:02 -08:00 committed by Commit bot
parent 480a65738c
commit ae0e92219b
6 changed files with 14 additions and 26 deletions

View File

@ -14,8 +14,6 @@ if (is_android) {
import("gni/v8.gni") import("gni/v8.gni")
import("gni/isolate.gni") import("gni/isolate.gni")
import("//build_overrides/v8.gni")
import("snapshot_toolchain.gni") import("snapshot_toolchain.gni")
declare_args() { declare_args() {
@ -155,7 +153,7 @@ config("external_config") {
defines = [ "USING_V8_SHARED" ] defines = [ "USING_V8_SHARED" ]
} }
include_dirs = [ "include" ] include_dirs = [ "include" ]
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
include_dirs += [ "$target_gen_dir/include" ] include_dirs += [ "$target_gen_dir/include" ]
} }
} }
@ -742,7 +740,7 @@ action("v8_dump_build_config") {
"is_tsan=$is_tsan", "is_tsan=$is_tsan",
"target_cpu=\"$target_cpu\"", "target_cpu=\"$target_cpu\"",
"v8_enable_i18n_support=$v8_enable_i18n_support", "v8_enable_i18n_support=$v8_enable_i18n_support",
"v8_enable_inspector=$v8_enable_inspector_override", "v8_enable_inspector=$v8_enable_inspector",
"v8_target_cpu=\"$v8_target_cpu\"", "v8_target_cpu=\"$v8_target_cpu\"",
"v8_use_snapshot=$v8_use_snapshot", "v8_use_snapshot=$v8_use_snapshot",
] ]
@ -2203,7 +2201,7 @@ v8_source_set("v8_base") {
deps += [ ":postmortem-metadata" ] deps += [ ":postmortem-metadata" ]
} }
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
deps += [ "src/inspector:inspector" ] deps += [ "src/inspector:inspector" ]
} }
} }
@ -2578,7 +2576,7 @@ v8_executable("d8") {
} }
defines = [] defines = []
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
defines += [ "V8_INSPECTOR_ENABLED" ] defines += [ "V8_INSPECTOR_ENABLED" ]
} }
} }

View File

@ -2,14 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/config/v8_target_cpu.gni") import("//build/config/v8_target_cpu.gni")
import("//gni/v8.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
if (((v8_current_cpu == "x86" || v8_current_cpu == "x64" || if (((v8_current_cpu == "x86" || v8_current_cpu == "x64" ||
v8_current_cpu == "x87") && (is_linux || is_mac)) || v8_current_cpu == "x87") && (is_linux || is_mac)) ||
@ -24,9 +17,4 @@ v8_extra_library_files = [ "//test/cctest/test-extra.js" ]
v8_experimental_extra_library_files = v8_experimental_extra_library_files =
[ "//test/cctest/test-experimental-extra.js" ] [ "//test/cctest/test-experimental-extra.js" ]
declare_args() { v8_enable_inspector_override = true
# Enable inspector. See include/v8-inspector.h.
v8_enable_inspector = true
}
v8_enable_inspector_override = v8_enable_inspector

View File

@ -3,7 +3,6 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/v8.gni")
import("//third_party/icu/config.gni") import("//third_party/icu/config.gni")
import("v8.gni") import("v8.gni")
@ -97,7 +96,7 @@ template("v8_isolate_run") {
} else { } else {
icu_use_data_file_flag = "0" icu_use_data_file_flag = "0"
} }
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
enable_inspector = "1" enable_inspector = "1"
} else { } else {
enable_inspector = "0" enable_inspector = "0"

View File

@ -4,6 +4,7 @@
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/v8_target_cpu.gni") import("//build/config/v8_target_cpu.gni")
import("//build_overrides/v8.gni")
declare_args() { declare_args() {
# Indicate if valgrind was fetched as a custom deps to make it available on # Indicate if valgrind was fetched as a custom deps to make it available on
@ -30,6 +31,9 @@ declare_args() {
# Enable ECMAScript Internationalization API. Enabling this feature will # Enable ECMAScript Internationalization API. Enabling this feature will
# add a dependency on the ICU library. # add a dependency on the ICU library.
v8_enable_i18n_support = true v8_enable_i18n_support = true
# Enable inspector. See include/v8-inspector.h.
v8_enable_inspector = v8_enable_inspector_override
} }
if (v8_use_external_startup_data == "") { if (v8_use_external_startup_data == "") {

View File

@ -3,7 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("../gni/isolate.gni") import("../gni/isolate.gni")
import("//build_overrides/v8.gni") import("../gni/v8.gni")
group("gn_all") { group("gn_all") {
testonly = true testonly = true
@ -21,7 +21,7 @@ group("gn_all") {
] ]
} }
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
deps += [ "inspector:inspector-test" ] deps += [ "inspector:inspector-test" ]
} }
@ -138,7 +138,7 @@ v8_isolate_run("fuzzer") {
v8_isolate_run("inspector-test") { v8_isolate_run("inspector-test") {
deps = [] deps = []
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
deps += [ "inspector:inspector-test" ] deps += [ "inspector:inspector-test" ]
} }

View File

@ -3,9 +3,8 @@
# found in the LICENSE file. # found in the LICENSE file.
import("../../gni/v8.gni") import("../../gni/v8.gni")
import("//build_overrides/v8.gni")
if (v8_enable_inspector_override) { if (v8_enable_inspector) {
v8_executable("inspector-test") { v8_executable("inspector-test") {
testonly = true testonly = true