Refactor how header defines are handled in V8 build files

TBR=yangguo@chromium.org

Change-Id: I28b549cc569e654482cc77f0de269eb33ea12569
Bug: v8:8788
Reviewed-on: https://chromium-review.googlesource.com/c/1463782
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59565}
This commit is contained in:
Sigurd Schneider 2019-02-11 17:11:08 +01:00 committed by Commit Bot
parent 34b67481db
commit b9ae3b7f1b
2 changed files with 51 additions and 48 deletions

View File

@ -222,20 +222,6 @@ v8_toolset_for_shell = "host"
###############################################################################
# Configurations
#
config("internal_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
include_dirs = [
".",
"$target_gen_dir",
]
configs = [ "//build/config/compiler:wexit_time_destructors" ]
if (is_component_build) {
defines = [ "BUILDING_V8_SHARED" ]
}
}
config("internal_config_base") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
@ -246,6 +232,21 @@ config("internal_config_base") {
]
}
config("internal_config") {
defines = []
visibility = [ ":*" ] # Only targets in this file can depend on this.
configs = [
"//build/config/compiler:wexit_time_destructors",
":internal_config_base",
":v8_header_features",
]
if (is_component_build) {
defines += [ "BUILDING_V8_SHARED" ]
}
}
# This config should be applied to code using the libplatform.
config("libplatform_config") {
include_dirs = [ "include" ]
@ -274,18 +275,10 @@ config("libsampler_config") {
# itself.
config("external_config") {
defines = []
configs = [ ":v8_header_features" ]
if (is_component_build) {
defines += [ "USING_V8_SHARED" ]
}
if (v8_enable_v8_checks) {
defines += [ "V8_ENABLE_CHECKS" ] # Used in "include/v8.h".
}
if (v8_deprecation_warnings) {
defines += [ "V8_DEPRECATION_WARNINGS" ]
}
if (v8_imminent_deprecation_warnings) {
defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
}
include_dirs = [
"include",
"$target_gen_dir/include",
@ -300,11 +293,39 @@ config("external_startup_data") {
}
}
# Put defines that are used in public headers here; public headers are
# defined in "v8_headers" and are included by embedders of V8.
config("v8_header_features") {
visibility = [ ":*" ]
defines = []
if (v8_enable_v8_checks) {
defines += [ "V8_ENABLE_CHECKS" ] # Used in "include/v8.h".
}
if (v8_enable_pointer_compression) {
defines += [ "V8_COMPRESS_POINTERS" ]
}
if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
}
if (v8_deprecation_warnings) {
defines += [ "V8_DEPRECATION_WARNINGS" ]
}
if (v8_imminent_deprecation_warnings) {
defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
}
}
# Put defines here that are only used in our internal files and NEVER in
# external headers that embedders (such as chromium and node) might include.
config("features") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
defines = []
configs = [ ":v8_header_features" ]
if (v8_embedder_string != "") {
defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
}
@ -336,12 +357,6 @@ config("features") {
if (v8_enable_minor_mc) {
defines += [ "ENABLE_MINOR_MC" ]
}
if (v8_enable_pointer_compression) {
defines += [ "V8_COMPRESS_POINTERS" ]
}
if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
}
if (v8_enable_object_print) {
defines += [ "OBJECT_PRINT" ]
}
@ -364,15 +379,6 @@ config("features") {
defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
}
if (v8_enable_v8_checks) {
defines += [ "V8_ENABLE_CHECKS" ]
}
if (v8_deprecation_warnings) {
defines += [ "V8_DEPRECATION_WARNINGS" ]
}
if (v8_imminent_deprecation_warnings) {
defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
}
if (v8_enable_i18n_support) {
defines += [ "V8_INTL_SUPPORT" ]
}
@ -1492,6 +1498,7 @@ v8_header_set("v8_version") {
# can depend upon to get basic v8 types.
v8_header_set("v8_headers") {
configs = [ ":internal_config" ]
public_configs = [ ":v8_header_features" ]
sources = [
"include/v8-internal.h",
@ -3325,7 +3332,7 @@ v8_source_set("v8_libsampler") {
"src/libsampler/sampler.h",
]
configs = [ ":internal_config_base" ]
configs = [ ":internal_config" ]
public_configs = [ ":libsampler_config" ]

View File

@ -63,22 +63,18 @@ inspector_protocol_generate("protocol_generated_sources") {
config("inspector_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
if (is_component_build) {
defines = [ "BUILDING_V8_SHARED" ]
}
configs = [ "../../:internal_config" ]
include_dirs = [ "../../include" ]
}
v8_source_set("inspector") {
deps = [
":protocol_generated_sources",
]
configs = [ ":inspector_config" ]
include_dirs = [
"../..",
"../../include",
"$target_gen_dir/../..",
"$target_gen_dir/../../include",
]
sources = rebase_path(_protocol_generated, ".", target_gen_dir)
sources += [
"../../include/v8-inspector-protocol.h",