cppgc: Expose feature defines to embedders

Bug: chromium:1056170
Change-Id: I303715630c79213d5b0dc34ff7107e8ffa973539
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557991
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71395}
This commit is contained in:
Michael Lippautz 2020-11-24 21:44:23 +01:00 committed by Commit Bot
parent c0c6078aef
commit e3d6433ba8

View File

@ -423,6 +423,7 @@ config("internal_config") {
"//build/config/compiler:wexit_time_destructors",
":internal_config_base",
":v8_header_features",
":cppgc_header_features",
]
if (is_component_build) {
@ -467,15 +468,6 @@ assert(!cppgc_is_standalone || !v8_use_perfetto)
# This config should be applied to code using the cppgc_base.
config("cppgc_base_config") {
defines = []
if (cppgc_enable_object_names) {
defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
}
if (cppgc_enable_caged_heap) {
defines += [ "CPPGC_CAGED_HEAP" ]
}
if (cppgc_enable_young_generation) {
defines += [ "CPPGC_YOUNG_GENERATION" ]
}
if (!cppgc_is_standalone) {
defines += [ "CPPGC_BUILD_IN_V8" ]
}
@ -490,7 +482,10 @@ config("libsampler_config") {
# itself.
config("external_config") {
defines = []
configs = [ ":v8_header_features" ]
configs = [
":v8_header_features",
":cppgc_header_features",
]
if (is_component_build) {
defines += [ "USING_V8_SHARED" ]
}
@ -541,6 +536,22 @@ config("v8_header_features") {
}
}
config("cppgc_header_features") {
visibility = [ ":*" ]
defines = []
if (cppgc_enable_object_names) {
defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
}
if (cppgc_enable_caged_heap) {
defines += [ "CPPGC_CAGED_HEAP" ]
}
if (cppgc_enable_young_generation) {
defines += [ "CPPGC_YOUNG_GENERATION" ]
}
}
# 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") {
@ -549,7 +560,10 @@ config("features") {
defines = []
configs = [ ":v8_header_features" ]
configs = [
":v8_header_features",
":cppgc_header_features",
]
if (v8_embedder_string != "") {
defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
@ -1973,7 +1987,10 @@ 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" ]
public_configs = [
":v8_header_features",
":cppgc_header_features",
]
sources = [
"include/v8-cppgc.h",
@ -4415,7 +4432,10 @@ v8_source_set("v8_cppgc_shared") {
# can depend upon to get basic cppgc types.
v8_header_set("cppgc_headers") {
configs = [ ":internal_config" ]
public_configs = [ ":v8_header_features" ]
public_configs = [
":v8_header_features",
":cppgc_header_features",
]
sources = [
"include/cppgc/garbage-collected.h",